diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-01-17 14:41:29 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-01-17 14:41:29 -0500 |
commit | 15e3241ba725a21604e0f3570e755a91b5edba00 (patch) | |
tree | d84be61c3a56ddc03eb927d5de5433afacadf64b /cloud-init-query.py | |
parent | 2f7227c7092ad873757167f62c2a82fb4ee69472 (diff) | |
download | vyos-cloud-init-15e3241ba725a21604e0f3570e755a91b5edba00.tar.gz vyos-cloud-init-15e3241ba725a21604e0f3570e755a91b5edba00.zip |
[PATCH] PEP8 coding style fixes.
From: Juerg Haefliger <juerg.haefliger@hp.com>
This pulls in the named patch for LP: #914739 with a few other changes.
Diffstat (limited to 'cloud-init-query.py')
-rwxr-xr-x | cloud-init-query.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cloud-init-query.py b/cloud-init-query.py index a066cb73..71987174 100755 --- a/cloud-init-query.py +++ b/cloud-init-query.py @@ -21,20 +21,23 @@ import sys import cloudinit import cloudinit.CloudConfig -def Usage(out = sys.stdout): + +def Usage(out=sys.stdout): out.write("Usage: %s name\n" % sys.argv[0]) - + + def main(): # expect to be called with name of item to fetch if len(sys.argv) != 2: Usage(sys.stderr) sys.exit(1) - cc = cloudinit.CloudConfig.CloudConfig(cloudinit.cloud_config) + cfg_path = cloudinit.get_ipath_cur("cloud_config") + cc = cloudinit.CloudConfig.CloudConfig(cfg_path) data = { - 'user_data' : cc.cloud.get_userdata(), - 'user_data_raw' : cc.cloud.get_userdata_raw(), - 'instance_id' : cc.cloud.get_instance_id(), + 'user_data': cc.cloud.get_userdata(), + 'user_data_raw': cc.cloud.get_userdata_raw(), + 'instance_id': cc.cloud.get_instance_id(), } name = sys.argv[1].replace('-', '_') |