summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-02-18 23:29:46 -0500
committerScott Moser <smoser@ubuntu.com>2011-02-18 23:29:46 -0500
commit8ff88d588b621fac74ffb7a798cfd54cf74729ed (patch)
tree8d267c74dbd90f80d413119e3853b50a460014a6 /cloudinit/CloudConfig/__init__.py
parentbd6994b299b20c28ec4221dc732cdb3f1480d58d (diff)
downloadvyos-cloud-init-8ff88d588b621fac74ffb7a798cfd54cf74729ed.tar.gz
vyos-cloud-init-8ff88d588b621fac74ffb7a798cfd54cf74729ed.zip
handle no datasource better cloud-init-cfg
previously, cloud-init-cfg would call CloudConfig with no cloud specified. Then, CloudConfig would get a new cloudinit instance and specify no ds_deps (which means network and local). If no cache was found, it would wait again for the Ec2 metadata service (even if it wasn't supposed to). Now, we get the cloud instance in the main program and attempt to get the data source, but only from [], which will get only cached. Then, if its not found, exit silently.
Diffstat (limited to 'cloudinit/CloudConfig/__init__.py')
-rw-r--r--cloudinit/CloudConfig/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/CloudConfig/__init__.py b/cloudinit/CloudConfig/__init__.py
index 0962c238..91853dfd 100644
--- a/cloudinit/CloudConfig/__init__.py
+++ b/cloudinit/CloudConfig/__init__.py
@@ -33,13 +33,13 @@ class CloudConfig():
cfgfile = None
cfg = None
- def __init__(self,cfgfile, cloud=None):
+ def __init__(self,cfgfile, cloud=None, ds_deps=[]):
if cloud == None:
- self.cloud = cloudinit.CloudInit()
+ self.cloud = cloudinit.CloudInit(ds_deps)
+ self.cloud.get_data_source()
else:
self.cloud = cloud
self.cfg = self.get_config_obj(cfgfile)
- self.cloud.get_data_source()
def get_config_obj(self,cfgfile):
try: