diff options
| author | Todd Willey <todd@ansolabs.com> | 2011-01-25 12:52:00 -0800 |
|---|---|---|
| committer | Todd Willey <todd@ansolabs.com> | 2011-01-25 12:52:00 -0800 |
| commit | 4e3524c57f6fa0f917bdb30ec15c8d4633a307e5 (patch) | |
| tree | 749656d687c9c9c5c11646e1971887aeecdf1507 /nova/api | |
| parent | a964fc3a8efad33b0dbb94e8a128c512a248f7f1 (diff) | |
Updates for provider_fw_rules in admin api.
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/admin.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/ec2/admin.py b/nova/api/ec2/admin.py index 4a34476d3..0dabf2092 100644 --- a/nova/api/ec2/admin.py +++ b/nova/api/ec2/admin.py @@ -223,7 +223,7 @@ class AdminController(object): """Returns status info for single node.""" return host_dict(db.host_get(name)) - def _provider_fw_rule_exists(context, rule): + def _provider_fw_rule_exists(self, context, rule): for old_rule in db.provider_fw_rule_get_all(context): for key in ('cidr', 'from_port', 'to_port', 'protocol'): dupe = True @@ -237,7 +237,10 @@ class AdminController(object): """Add provider-level firewall rules to block incoming traffic.""" LOG.audit(_("Blocking traffic to all projects incoming from %s"), cidr, context=context) - rule = {'cidr': IPy.IP(urllib.unquote(cidr).decode())} + cidr = urllib.unquote(cidr).decode() + # raise if invalid + IPy.IP(cidr) + rule = {'cidr': cidr} tcp_rule = rule.copy() tcp_rule.update({"protocol": "TCP", "from_port": 1, "to_port": 65535}) udp_rule = rule.copy() |
