Merge lp:~devcamcar/nova-adminclient/latest_client into lp:nova-adminclient

Proposed by Devin Carlen
Status: Merged
Approved by: Devin Carlen
Approved revision: 5
Merged at revision: 4
Proposed branch: lp:~devcamcar/nova-adminclient/latest_client
Merge into: lp:nova-adminclient
Diff against target: 85 lines (+26/-6)
2 files modified
nova_adminclient/client.py (+23/-2)
setup.py (+3/-4)
To merge this branch: bzr merge lp:~devcamcar/nova-adminclient/latest_client
Reviewer Review Type Date Requested Status
Devin Carlen Approve
Review via email: mp+55660@code.launchpad.net

Description of the change

Incorporated latest changes from nova's adminclient.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova_adminclient/client.py'
2--- nova_adminclient/client.py 2011-03-16 04:52:32 +0000
3+++ nova_adminclient/client.py 2011-03-31 01:42:23 +0000
4@@ -15,7 +15,6 @@
5 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
6 # License for the specific language governing permissions and limitations
7 # under the License.
8-
9 """
10 Nova User API client library.
11 """
12@@ -265,6 +264,20 @@
13 else:
14 setattr(self, name, str(value))
15
16+class StatusResponse(object):
17+ def __init__(self, connection=None):
18+ self.connection = connection
19+ self.status = None
20+
21+ def __repr__(self):
22+ return 'Status:%s' % self.status
23+
24+ def startElement(self, name, attrs, connection):
25+ return None
26+
27+ def endElement(self, name, value, connection):
28+ setattr(self, name, str(value))
29+
30
31 class NovaAdminClient(object):
32
33@@ -326,7 +339,7 @@
34 def get_user(self, name):
35 """Grab a single user by name."""
36 try:
37- return self.apiconn.get_object('DescribeUser',
38+ user = self.apiconn.get_object('DescribeUser',
39 {'Name': name},
40 UserInfo)
41 except boto.exception.BotoServerError, e:
42@@ -334,6 +347,9 @@
43 return None
44 raise
45
46+ if user.username != None:
47+ return user
48+
49 def has_user(self, username):
50 """Determine if user exists."""
51 return self.get_user(username) != None
52@@ -475,3 +491,8 @@
53 """Grabs the list of all users."""
54 return self.apiconn.get_list('DescribeInstanceTypes', {},
55 [('item', InstanceType)])
56+
57+ def disable_project_credentials(self, project):
58+ """Revoke project credentials and kill the cloudpipe/vpn instance."""
59+ return self.apiconn.get_object('DisableProjectCredentials',
60+ {'Project': project}, StatusResponse)
61
62=== modified file 'setup.py' (properties changed: -x to +x)
63--- setup.py 2011-03-30 15:57:16 +0000
64+++ setup.py 2011-03-31 01:42:23 +0000
65@@ -17,17 +17,16 @@
66 # under the License.
67
68 import os
69-from setuptools import setup
70-
71+from setuptools import setup, find_packages
72
73 setup(name = "nova-adminclient",
74- version = "0.1.3",
75+ version = "0.1.5",
76 license = 'Apache License (2.0)',
77 description = "client for administering OpenStack Nova",
78 author = 'OpenStack',
79 author_email = 'nova@lists.launchpad.net',
80 url='http://www.openstack.org',
81- packages = ['nova_adminclient'],
82+ packages = find_packages(),
83 install_requires = ['setuptools', 'boto==1.9b'],
84 classifiers = [
85 'Development Status :: 5 - Production/Stable',

Subscribers

People subscribed via source and target branches

to all changes: