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:
Danny Al-Gaaf 2014-08-13 13:12:19 +02:00
parent 4f44d72d9c
commit d1809674a7
1 changed files with 7 additions and 1 deletions

View File

@ -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)