diff options
author | Scott Moser <smoser@brickies.net> | 2016-08-23 16:48:39 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2016-08-23 16:48:39 -0400 |
commit | bbcffb40f8e721f8d5ff396a8fd3f0337f299394 (patch) | |
tree | 1ba65a8b98cef85e89f7414040ff2848e54641aa /cloudinit/sources/DataSourceBigstep.py | |
parent | dbae06eec6a25592593f19f4f40bd03668098d9c (diff) | |
parent | 8a929e66f2fe2aaed968ec23aeaf6d3b3c68cb65 (diff) | |
download | vyos-cloud-init-bbcffb40f8e721f8d5ff396a8fd3f0337f299394.tar.gz vyos-cloud-init-bbcffb40f8e721f8d5ff396a8fd3f0337f299394.zip |
merge trunk at 0.7.7~bzr1182
Diffstat (limited to 'cloudinit/sources/DataSourceBigstep.py')
-rw-r--r-- | cloudinit/sources/DataSourceBigstep.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceBigstep.py b/cloudinit/sources/DataSourceBigstep.py index c22ffdb6..b5ee4129 100644 --- a/cloudinit/sources/DataSourceBigstep.py +++ b/cloudinit/sources/DataSourceBigstep.py @@ -5,6 +5,7 @@ # import json +import errno from cloudinit import log as logging from cloudinit import sources @@ -23,6 +24,8 @@ class DataSourceBigstep(sources.DataSource): def get_data(self, apply_filter=False): url = get_url_from_file() + if url is None: + return False response = url_helper.readurl(url) decoded = json.loads(response.contents) self.metadata = decoded["metadata"] @@ -32,7 +35,15 @@ class DataSourceBigstep(sources.DataSource): def get_url_from_file(): - content = util.load_file("/var/lib/cloud/data/seed/bigstep/url") + try: + content = util.load_file("/var/lib/cloud/data/seed/bigstep/url") + except IOError as e: + # If the file doesn't exist, then the server probably isn't a Bigstep + # instance; otherwise, another problem exists which needs investigation + if e.errno == errno.ENOENT: + return None + else: + raise return content # Used to match classes to dependencies |