diff options
author | Todd Willey <todd@ansolabs.com> | 2011-01-11 18:03:15 -0500 |
---|---|---|
committer | Todd Willey <todd@ansolabs.com> | 2011-01-11 18:03:15 -0500 |
commit | 0ac0cd5976ad6b053aa011071194614ee4f70c48 (patch) | |
tree | 998838551caf9858b8dcca28a4722afc3e5bf1c6 | |
parent | 0d15149103c57ad419e65fd5e66f49bcd3334b27 (diff) | |
download | nova-0ac0cd5976ad6b053aa011071194614ee4f70c48.tar.gz nova-0ac0cd5976ad6b053aa011071194614ee4f70c48.tar.xz nova-0ac0cd5976ad6b053aa011071194614ee4f70c48.zip |
Raise meaningful exception when there aren't enough params for a sec group rule.
-rw-r--r-- | nova/api/ec2/cloud.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 99a9677c4..135836348 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -399,8 +399,8 @@ class CloudController(object): criteria = self._revoke_rule_args_to_dict(context, **kwargs) if criteria == None: - raise exception.ApiError(_("No rule for the specified " - "parameters.")) + raise exception.ApiError(_("Not enough parameters to build a " + "valid rule.")) for rule in security_group.rules: match = True @@ -427,6 +427,9 @@ class CloudController(object): group_name) values = self._revoke_rule_args_to_dict(context, **kwargs) + if values is None: + raise exception.ApiError(_("Not enough parameters to build a " + "valid rule.")) values['parent_group_id'] = security_group.id if self._security_group_rule_exists(security_group, values): |