summaryrefslogtreecommitdiff
path: root/cloudinit/sources/helpers/azure.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-11-18 13:35:00 -0500
committerScott Moser <smoser@ubuntu.com>2015-11-18 13:35:00 -0500
commit97fbe6e44fc09d7522001deb7e3984272e9c26b7 (patch)
treea12b95655103dec6944409508a70ce72855b1d1a /cloudinit/sources/helpers/azure.py
parent0e0e590b60ad3f5d1ef66ef7f7df271c4bc09c7f (diff)
parent34b208a05361ae6ab4a51a6a999c9ac4ab77f06a (diff)
downloadvyos-cloud-init-97fbe6e44fc09d7522001deb7e3984272e9c26b7.tar.gz
vyos-cloud-init-97fbe6e44fc09d7522001deb7e3984272e9c26b7.zip
Azure: get instance id from dmi instead of SharedConfig
Replace the use of SharedConfig.xml in both the walinuxagent case, and the case where we communicate with the Azure fabric ourselves. The instance id present in the dmi data is unfortunately different that that in the SharedConfig. This means that something needs to handle migration so that a reboot after newer version is installed will not re-run first instance things. In Ubuntu this is being handled in packaging. LP: #1506187
Diffstat (limited to 'cloudinit/sources/helpers/azure.py')
-rw-r--r--cloudinit/sources/helpers/azure.py21
1 files changed, 0 insertions, 21 deletions
diff --git a/cloudinit/sources/helpers/azure.py b/cloudinit/sources/helpers/azure.py
index 281d733e..d90c22fd 100644
--- a/cloudinit/sources/helpers/azure.py
+++ b/cloudinit/sources/helpers/azure.py
@@ -79,12 +79,6 @@ class GoalState(object):
'./Container/RoleInstanceList/RoleInstance/InstanceId')
@property
- def shared_config_xml(self):
- url = self._text_from_xpath('./Container/RoleInstanceList/RoleInstance'
- '/Configuration/SharedConfig')
- return self.http_client.get(url).contents
-
- @property
def certificates_xml(self):
if self._certificates_xml is None:
url = self._text_from_xpath(
@@ -172,19 +166,6 @@ class OpenSSLManager(object):
return keys
-def iid_from_shared_config_content(content):
- """
- find INSTANCE_ID in:
- <?xml version="1.0" encoding="utf-8"?>
- <SharedConfig version="1.0.0.0" goalStateIncarnation="1">
- <Deployment name="INSTANCE_ID" guid="{...}" incarnation="0">
- <Service name="..." guid="{00000000-0000-0000-0000-000000000000}"/>
- """
- root = ElementTree.fromstring(content)
- depnode = root.find('Deployment')
- return depnode.get('name')
-
-
class WALinuxAgentShim(object):
REPORT_READY_XML_TEMPLATE = '\n'.join([
@@ -263,8 +244,6 @@ class WALinuxAgentShim(object):
public_keys = self.openssl_manager.parse_certificates(
goal_state.certificates_xml)
data = {
- 'instance-id': iid_from_shared_config_content(
- goal_state.shared_config_xml),
'public-keys': public_keys,
}
self._report_ready(goal_state, http_client)