You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/09/21 12:42:29 UTC
svn commit: r1173565 - /libcloud/trunk/libcloud/dns/types.py
Author: tomaz
Date: Wed Sep 21 10:42:28 2011
New Revision: 1173565
URL: http://svn.apache.org/viewvc?rev=1173565&view=rev
Log:
Add Provider ENUm and add __repr__ method to RecordType.
Modified:
libcloud/trunk/libcloud/dns/types.py
Modified: libcloud/trunk/libcloud/dns/types.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/dns/types.py?rev=1173565&r1=1173564&r2=1173565&view=diff
==============================================================================
--- libcloud/trunk/libcloud/dns/types.py (original)
+++ libcloud/trunk/libcloud/dns/types.py Wed Sep 21 10:42:28 2011
@@ -16,6 +16,7 @@
from libcloud.common.types import LibcloudError
__all__ = [
+ 'Provider',
'RecordType',
'ZoneError',
'ZoneDoesNotExistError',
@@ -26,6 +27,11 @@ __all__ = [
]
+class Provider(object):
+ DUMMY = 0
+ LINODE = 1
+
+
class RecordType(object):
"""
DNS record type.
@@ -42,6 +48,11 @@ class RecordType(object):
SPF = 9
SRV = 10
+ @classmethod
+ def __repr__(self, value):
+ reverse = dict((v, k) for k, v in RecordType.__dict__.items())
+ return reverse[value]
+
class ZoneError(LibcloudError):
error_type = 'ZoneError'