Remove pylint errors for undefined GroupException members

Pylint complains about 'SecurityGroupBase' has no 'raise_group_already_exists'
member as these methods are called from SecurityGroupBase but do not exist in
this class. This is fine as this class is not invoked directly. This patch
adds these prototypes which raise NotImplementedError and changes the
inheritance order as to not raise NotImplementedError.

Fixes bug 1138269

Change-Id: I2d7b723a482dc8ca845e52e2a8f44c6fd31fa5db
This commit is contained in:
Aaron Rosen 2013-03-01 10:23:01 -08:00
parent 11764e5250
commit 35b2b2c5c4
3 changed files with 32 additions and 8 deletions

View File

@ -1700,13 +1700,13 @@ class EC2SecurityGroupExceptions(object):
pass
class CloudSecurityGroupNovaAPI(compute_api.SecurityGroupAPI,
EC2SecurityGroupExceptions):
class CloudSecurityGroupNovaAPI(EC2SecurityGroupExceptions,
compute_api.SecurityGroupAPI):
pass
class CloudSecurityGroupQuantumAPI(quantum_driver.SecurityGroupAPI,
EC2SecurityGroupExceptions):
class CloudSecurityGroupQuantumAPI(EC2SecurityGroupExceptions,
quantum_driver.SecurityGroupAPI):
pass

View File

@ -622,11 +622,11 @@ class NativeSecurityGroupExceptions(object):
raise exc.HTTPNotFound(explanation=msg)
class NativeNovaSecurityGroupAPI(compute_api.SecurityGroupAPI,
NativeSecurityGroupExceptions):
class NativeNovaSecurityGroupAPI(NativeSecurityGroupExceptions,
compute_api.SecurityGroupAPI):
pass
class NativeQuantumSecurityGroupAPI(quantum_driver.SecurityGroupAPI,
NativeSecurityGroupExceptions):
class NativeQuantumSecurityGroupAPI(NativeSecurityGroupExceptions,
quantum_driver.SecurityGroupAPI):
pass

View File

@ -194,3 +194,27 @@ class SecurityGroupBase(object):
def rule_exists(self, security_group, new_rule):
raise NotImplementedError()
@staticmethod
def raise_invalid_property(msg):
raise NotImplementedError()
@staticmethod
def raise_group_already_exists(msg):
raise NotImplementedError()
@staticmethod
def raise_invalid_group(msg):
raise NotImplementedError()
@staticmethod
def raise_invalid_cidr(cidr, decoding_exception=None):
raise NotImplementedError()
@staticmethod
def raise_over_quota(msg):
raise NotImplementedError()
@staticmethod
def raise_not_found(msg):
raise NotImplementedError()