added back code for testing
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/14d29cd1 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/14d29cd1 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/14d29cd1 Branch: refs/heads/trunk Commit: 14d29cd1d6dad42b234c7a55d1558e5466bb1f7c Parents: a14aa6f Author: mitch <[email protected]> Authored: Thu Oct 4 08:06:53 2018 -0400 Committer: mitch <[email protected]> Committed: Thu Oct 4 08:06:53 2018 -0400 ---------------------------------------------------------------------- libcloud/common/nttcis.py | 3 --- libcloud/compute/drivers/nttcis.py | 14 +++++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/14d29cd1/libcloud/common/nttcis.py ---------------------------------------------------------------------- diff --git a/libcloud/common/nttcis.py b/libcloud/common/nttcis.py index 4d9473b..23a4db5 100644 --- a/libcloud/common/nttcis.py +++ b/libcloud/common/nttcis.py @@ -18,9 +18,6 @@ NTTCIS Common Components from io import BytesIO from base64 import b64encode from time import sleep -from collections.abc import MutableSequence, Mapping -from lxml import etree -from copy import deepcopy # TODO: use disutils.version when Travis CI fixed the pylint issue with version # from distutils.version import LooseVersion from libcloud.utils.py3 import httplib http://git-wip-us.apache.org/repos/asf/libcloud/blob/14d29cd1/libcloud/compute/drivers/nttcis.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py index 84aaa0d..e1b5ec1 100644 --- a/libcloud/compute/drivers/nttcis.py +++ b/libcloud/compute/drivers/nttcis.py @@ -22,7 +22,6 @@ from libcloud.common.exceptions import BaseHTTPError from libcloud.compute.base import NodeDriver, Node, NodeAuthPassword from libcloud.compute.base import NodeSize, NodeImage, NodeLocation from libcloud.common.nttcis import dd_object_to_id -from libcloud.common.nttcis import process_xml from libcloud.common.nttcis import NttCisAPIException from libcloud.common.nttcis import (NttCisConnection, NttCisStatus) @@ -4968,10 +4967,15 @@ class NttCisNodeDriver(NodeDriver): return [self._to_snapshot(el) for el in snapshot_elements] def _to_snapshot(self, element: ET): - ET.register_namespace("", "urn:didata.com:api:cloud:types") - snap_shot_xml = ET.tostring(element) - print() - return process_xml(snap_shot_xml) + return {'id': element.get('id'), 'start_time': + findtext(element, 'startTime', TYPES_URN), + 'end_time': findtext(element, 'endTime', TYPES_URN), + 'expiry_time': findtext(element, 'expiryTime', TYPES_URN), + 'type': findtext(element, 'type', TYPES_URN), + 'state': findtext(element, 'state', TYPES_URN), + 'server_config': self.to_snapshot_conf_elems( + findtext(element, 'serverConfig', TYPES_URN)) + } def _to_ipv4_addresses(self, object): ipv4_address_elements = object.findall(fixxpath('ipv4', TYPES_URN))
