summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceMAAS.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2012-10-23 18:58:32 +0200
committerScott Moser <smoser@brickies.net>2012-10-23 18:58:32 +0200
commit71b4108d029fff61ff8183ffbd77917569bea2cd (patch)
tree6564cd3f5faa26fb1c843b14d27ca6eaa23164f0 /cloudinit/sources/DataSourceMAAS.py
parentcb5893c3e3f635de4fef86f0a19be0ada0054930 (diff)
parente8a10a41d22876d555084def823817337d9c2a80 (diff)
downloadvyos-cloud-init-71b4108d029fff61ff8183ffbd77917569bea2cd.tar.gz
vyos-cloud-init-71b4108d029fff61ff8183ffbd77917569bea2cd.zip
use only util methods for reading/loading/appending/peeking
Use only util methods for reading/loading/appending/peeking at files since it is likely soon that we will add a new way of adjusting the root of files read, also it is useful for debugging to track what is being read/written in a central fashion.
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 e187aec9..b55d8a21 100644
--- a/cloudinit/sources/DataSourceMAAS.py
+++ b/cloudinit/sources/DataSourceMAAS.py
@@ -336,8 +336,7 @@ if __name__ == "__main__":
'token_secret': args.tsec, 'consumer_secret': args.csec}
if args.config:
- with open(args.config) as fp:
- cfg = util.load_yaml(fp.read())
+ cfg = util.read_conf(args.config)
if 'datasource' in cfg:
cfg = cfg['datasource']['MAAS']
for key in creds.keys():
@@ -346,7 +345,7 @@ if __name__ == "__main__":
def geturl(url, headers_cb):
req = urllib2.Request(url, data=None, headers=headers_cb(url))
- return(urllib2.urlopen(req).read())
+ return (urllib2.urlopen(req).read())
def printurl(url, headers_cb):
print "== %s ==\n%s\n" % (url, geturl(url, headers_cb))