diff options
author | Vaidas Jablonskis <jablonskis@gmail.com> | 2014-02-08 20:59:52 +0000 |
---|---|---|
committer | Vaidas Jablonskis <jablonskis@gmail.com> | 2014-02-08 20:59:52 +0000 |
commit | aa1d0328da6ae1ace03e327feafabcf84f91b2b5 (patch) | |
tree | 09d9bd88d77c76bb463393e2e4a4432bf561dcf6 /cloudinit/sources/DataSourceGCE.py | |
parent | 64b35a9c3b201aed5073823fd4a15ecb15195aea (diff) | |
download | vyos-cloud-init-aa1d0328da6ae1ace03e327feafabcf84f91b2b5.tar.gz vyos-cloud-init-aa1d0328da6ae1ace03e327feafabcf84f91b2b5.zip |
wrap url get call in try/except clause
Diffstat (limited to 'cloudinit/sources/DataSourceGCE.py')
-rw-r--r-- | cloudinit/sources/DataSourceGCE.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceGCE.py b/cloudinit/sources/DataSourceGCE.py index 8a46f933..c96cfffd 100644 --- a/cloudinit/sources/DataSourceGCE.py +++ b/cloudinit/sources/DataSourceGCE.py @@ -52,7 +52,10 @@ class DataSourceGCE(sources.DataSource): } for mkey in url_map.iterkeys(): - resp = url_helper.readurl(url=url_map[mkey], headers=headers) + try: + resp = url_helper.readurl(url=url_map[mkey], headers=headers) + except IOError: + return False if resp.ok(): if mkey == 'public-keys': pub_keys = [self._trim_key(k) for k in resp.contents.splitlines()] |