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.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/cloudinit/sources/DataSourceMAAS.py b/cloudinit/sources/DataSourceMAAS.py
index c172150b..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,7 +336,6 @@ if __name__ == "__main__":
'token_secret': args.tsec, 'consumer_secret': args.csec}
if args.config:
- import yaml
with open(args.config) as fp:
cfg = util.load_yaml(fp.read())
if 'datasource' in cfg: