You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2016/03/15 22:12:59 UTC
[3/4] libcloud git commit: Quick fixes to backups
Quick fixes to backups
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/fd7effb1
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/fd7effb1
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/fd7effb1
Branch: refs/heads/trunk
Commit: fd7effb18c24cb6308611f9755f537cb9e46c70c
Parents: 18d4c42
Author: Jeffrey Dunham <je...@gmail.com>
Authored: Sat Mar 5 19:44:48 2016 -0500
Committer: anthony-shaw <an...@gmail.com>
Committed: Wed Mar 16 08:12:26 2016 +1100
----------------------------------------------------------------------
libcloud/backup/drivers/dimensiondata.py | 15 +++++++++++----
libcloud/common/dimensiondata.py | 8 ++++----
2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/fd7effb1/libcloud/backup/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/backup/drivers/dimensiondata.py b/libcloud/backup/drivers/dimensiondata.py
index 4c0319a..d47f889 100644
--- a/libcloud/backup/drivers/dimensiondata.py
+++ b/libcloud/backup/drivers/dimensiondata.py
@@ -180,7 +180,8 @@ class DimensionDataBackupDriver(BackupDriver):
return NotImplementedError(
'create_target_from_container not supported for this driver')
- def update_target(self, target, name=None, address=None, extra=None):
+ def update_target(self, target, name=None, address=None, extra=None,
+ type=BackupTargetType.VIRTUAL):
"""
Update the properties of a backup target, only changing the serviceplan
is supported.
@@ -208,8 +209,14 @@ class DimensionDataBackupDriver(BackupDriver):
'server/%s/backup/modify' % (server_id),
method='POST',
data=ET.tostring(request)).object
- target.extra = extra
- return target
+ return BackupTarget(
+ id=server_id,
+ name=name,
+ address=address,
+ type=type,
+ extra=extra,
+ driver=self
+ )
def delete_target(self, target):
"""
@@ -558,7 +565,7 @@ class DimensionDataBackupDriver(BackupDriver):
return DimensionDataBackupDetails(
asset_id=object.get('asset_id'),
service_plan=object.get('servicePlan'),
- state=object.get('state'),
+ status=object.get('state'),
clients=self._to_clients(object)
)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/fd7effb1/libcloud/common/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/common/dimensiondata.py b/libcloud/common/dimensiondata.py
index 635ee5e..9178599 100644
--- a/libcloud/common/dimensiondata.py
+++ b/libcloud/common/dimensiondata.py
@@ -1079,7 +1079,7 @@ class DimensionDataBackupDetails(object):
a targets backups configuration
"""
- def __init__(self, asset_id, service_plan, state, clients=None):
+ def __init__(self, asset_id, service_plan, status, clients=None):
"""
Initialize an instance of :class:`DimensionDataBackupDetails`
@@ -1089,15 +1089,15 @@ class DimensionDataBackupDetails(object):
:param service_plan: The service plan for backups. i.e (Essentials)
:type service_plan: ``str``
- :param state: The overall state this backup target. i.e. (unregistered)
- :type state: ``str``
+ :param status: The overall status this backup target. i.e. (unregistered)
+ :type status: ``str``
:param clients: Backup clients attached to this target
:type clients: ``list`` of :class:`DimensionDataBackupClient`
"""
self.asset_id = asset_id
self.service_plan = service_plan
- self.state = state
+ self.status = status
self.clients = clients
def __repr__(self):