summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceMAAS.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/sources/DataSourceMAAS.py')
-rw-r--r--cloudinit/sources/DataSourceMAAS.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/cloudinit/sources/DataSourceMAAS.py b/cloudinit/sources/DataSourceMAAS.py
index 581e9a4b..e187aec9 100644
--- a/cloudinit/sources/DataSourceMAAS.py
+++ b/cloudinit/sources/DataSourceMAAS.py
@@ -145,10 +145,10 @@ class DataSourceMAAS(sources.DataSource):
def _except_cb(self, msg, exception):
if not (isinstance(exception, urllib2.HTTPError) and
- exception.code == 403):
+ (exception.code == 403 or exception.code == 401)):
return
if 'date' not in exception.headers:
- LOG.warn("date field not in 403 headers")
+ LOG.warn("date field not in %d headers" % exception.code)
return
date = exception.headers['date']
@@ -336,9 +336,8 @@ if __name__ == "__main__":
'token_secret': args.tsec, 'consumer_secret': args.csec}
if args.config:
- import yaml
with open(args.config) as fp:
- cfg = yaml.safe_load(fp)
+ cfg = util.load_yaml(fp.read())
if 'datasource' in cfg:
cfg = cfg['datasource']['MAAS']
for key in creds.keys():