Use python abc in DeletableResource class
Fix pylint error about NotImplemented raised instead of NotImplementedError. Use the abc class instead of NotImplementedError. Partial-Bug: #1346797 Change-Id: I50df1edf5c6b5c7a5c385a6389da97ffffea4d07 Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
parent
4f44d72d9c
commit
d1809674a7
|
@ -13,6 +13,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
|
||||
class AttributeDict(dict):
|
||||
|
||||
|
@ -27,6 +31,7 @@ class AttributeDict(dict):
|
|||
return super(AttributeDict, self).__getattribute__(name)
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class DeletableResource(AttributeDict):
|
||||
|
||||
"""
|
||||
|
@ -42,8 +47,9 @@ class DeletableResource(AttributeDict):
|
|||
return '<%s id="%s" name="%s">' % (self.__class__.__name__,
|
||||
self.id, self.name)
|
||||
|
||||
@abc.abstractmethod
|
||||
def delete(self):
|
||||
raise NotImplemented()
|
||||
return
|
||||
|
||||
def __hash__(self):
|
||||
return id(self)
|
||||
|
|
Loading…
Reference in New Issue