diff options
author | zhanggang <zhanggang@cmss.chinamobile.com> | 2017-12-22 04:35:13 -0500 |
---|---|---|
committer | zhanggang <zhanggang@cmss.chinamobile.com> | 2017-12-22 23:16:33 -0500 |
commit | 7e5c7a4687d0418f3858e162d0d84b61385a9340 (patch) | |
tree | fa3d60f9c48ebd5da4e700ac707cf485179c5282 /trove/extensions | |
parent | 0f5763e1646cd6286481834924e10e6f8152e7b7 (diff) | |
download | trove-7e5c7a4687d0418f3858e162d0d84b61385a9340.tar.gz |
Fix wrong error message for secgroup_rule method
In method `create_sec_group_rule`, when add_rule raise error.
The error message would confuse the user, it failed to create
secgroup_rule, not secgroup. In method `delete` of class
`SecurityGroupRule` is the same problem, fail delete a secgroup rule,
not a secgroup.
Change-Id: Id5ad4a7b8a4d292ba0a0bef5231db8d6af8eb29a
Diffstat (limited to 'trove/extensions')
-rw-r--r-- | trove/extensions/security_group/models.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/trove/extensions/security_group/models.py b/trove/extensions/security_group/models.py index 575ec95b..5e191437 100644 --- a/trove/extensions/security_group/models.py +++ b/trove/extensions/security_group/models.py @@ -153,7 +153,7 @@ class SecurityGroupRule(DatabaseModelBase): if not remote_rule_id: raise exception.SecurityGroupRuleCreationError( - "Failed to create Security Group Rule") + "Failed to create Remote Security Group Rule") else: # Create db record return cls.create( @@ -165,7 +165,7 @@ class SecurityGroupRule(DatabaseModelBase): group_id=sec_group['id']) except exception.SecurityGroupRuleCreationError: - LOG.exception(_("Failed to create remote security group.")) + LOG.exception(_("Failed to create remote security group rule.")) raise def get_security_group(self, tenant_id): @@ -179,9 +179,9 @@ class SecurityGroupRule(DatabaseModelBase): RemoteSecurityGroup.delete_rule(self.id, context, region_name) super(SecurityGroupRule, self).delete() except exception.TroveError: - LOG.exception(_('Failed to delete security group.')) + LOG.exception(_('Failed to delete remote security group rule.')) raise exception.SecurityGroupRuleDeletionError( - "Failed to delete Security Group") + "Failed to delete Remote Security Group Rule") class SecurityGroupInstanceAssociation(DatabaseModelBase): |