Merge lp:~xtoddx/nova-adminclient/provider_fw_rules into lp:nova-adminclient

Proposed by Todd Willey
Status: Merged
Approved by: Devin Carlen
Approved revision: 7
Merged at revision: 7
Proposed branch: lp:~xtoddx/nova-adminclient/provider_fw_rules
Merge into: lp:nova-adminclient
Diff against target: 59 lines (+33/-1)
2 files modified
nova_adminclient/client.py (+32/-0)
setup.py (+1/-1)
To merge this branch: bzr merge lp:~xtoddx/nova-adminclient/provider_fw_rules
Reviewer Review Type Date Requested Status
Devin Carlen Approve
Review via email: mp+64320@code.launchpad.net

Description of the change

Add provider firewall rules handlers.

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

lgtm

review: Approve
Revision history for this message
Devin Carlen (devcamcar) wrote :

Actually - needs one minor bit. Can you bump the version number in setup.py? I'll push to pypi once you do that.

review: Needs Fixing
7. By Todd Willey

Bump revno.

Revision history for this message
Todd Willey (xtoddx) wrote :

All better now.

Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Devin Carlen (devcamcar) wrote :

0.1.8 uploaded to pypi

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-05-21 04:34:25 +0000
3+++ nova_adminclient/client.py 2011-06-12 16:22:23 +0000
4@@ -264,6 +264,21 @@
5 else:
6 setattr(self, name, str(value))
7
8+class IpBlock(object):
9+ def __init__(self, connection=None):
10+ self.connection = connection
11+ self.cidr = None
12+
13+ def __repr__(self):
14+ return 'IpBlock:%s' % self.cidr
15+
16+ def startElement(self, name, attrs, connection):
17+ return None
18+
19+ def endElement(self, name, value, connection):
20+ if name == 'cidr':
21+ self.cidr = str(value)
22+
23 class StatusResponse(object):
24 def __init__(self, connection=None):
25 self.connection = connection
26@@ -496,3 +511,20 @@
27 """Revoke project credentials and kill the cloudpipe/vpn instance."""
28 return self.apiconn.get_object('DisableProjectCredentials',
29 {'Project': project}, StatusResponse)
30+
31+ def block_ips(self, cidr):
32+ """Block incoming traffic from specified hosts."""
33+ return self.apiconn.get_object('BlockExternalAddresses',
34+ {'Cidr': cidr}, StatusResponse)
35+
36+ def get_ip_blocks(self):
37+ """Block incoming traffic from specified hosts."""
38+ return self.apiconn.get_list('DescribeExternalAddressBlocks', {},
39+ [('item', IpBlock)])
40+ return self.apiconn.get_list('DescribeExternalAddressBlocks', {}
41+ [('item', IpBlock)])
42+
43+ def remove_ip_block(self, cidr):
44+ """Block incoming traffic from specified hosts."""
45+ return self.apiconn.get_object('RemoveExternalAddressBlock',
46+ {'Cidr': cidr}, StatusResponse)
47
48=== modified file 'setup.py'
49--- setup.py 2011-05-21 04:34:25 +0000
50+++ setup.py 2011-06-12 16:22:23 +0000
51@@ -20,7 +20,7 @@
52 from setuptools import setup, find_packages
53
54 setup(name = "nova-adminclient",
55- version = "0.1.7",
56+ version = "0.1.8",
57 license = 'Apache License (2.0)',
58 description = "client for administering OpenStack Nova",
59 author = 'OpenStack',

Subscribers

People subscribed via source and target branches