diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-01-17 12:41:09 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-01-17 12:41:09 -0500 |
commit | ec070cdf8746651d6dea011bd3ea9a445223028c (patch) | |
tree | acc620e1f0423910a4d0ea0d79ee231290e4a393 /cloudinit/CloudConfig/cc_chef.py | |
parent | 1a1da7c11e8bbb7e9f4b06a06ee5d6b18fdc1efc (diff) | |
download | vyos-cloud-init-ec070cdf8746651d6dea011bd3ea9a445223028c.tar.gz vyos-cloud-init-ec070cdf8746651d6dea011bd3ea9a445223028c.zip |
[PATCH 4/4] Fix pylint conventions C0301 (line too long)
From: Juerg Haefliger <juerg.haefliger@hp.com>
Diffstat (limited to 'cloudinit/CloudConfig/cc_chef.py')
-rw-r--r-- | cloudinit/CloudConfig/cc_chef.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/cloudinit/CloudConfig/cc_chef.py b/cloudinit/CloudConfig/cc_chef.py index 55ecdab4..4f740aff 100644 --- a/cloudinit/CloudConfig/cc_chef.py +++ b/cloudinit/CloudConfig/cc_chef.py @@ -36,7 +36,8 @@ def handle(_name, cfg, cloud, log, _args): # set the validation key based on the presence of either 'validation_key' # or 'validation_cert'. In the case where both exist, 'validation_key' # takes precedence - if chef_cfg.has_key('validation_key') or chef_cfg.has_key('validation_cert'): + if (chef_cfg.has_key('validation_key') or + chef_cfg.has_key('validation_cert')): validation_key = util.get_cfg_option_str(chef_cfg, 'validation_key', chef_cfg['validation_cert']) with open('/etc/chef/validation.pem', 'w') as validation_key_fh: @@ -44,12 +45,12 @@ def handle(_name, cfg, cloud, log, _args): # create the chef config from template util.render_to_file('chef_client.rb', '/etc/chef/client.rb', - {'server_url': chef_cfg['server_url'], - 'node_name': util.get_cfg_option_str(chef_cfg, 'node_name', - cloud.datasource.get_instance_id()), - 'environment': util.get_cfg_option_str(chef_cfg, 'environment', - '_default'), - 'validation_name': chef_cfg['validation_name']}) + {'server_url': chef_cfg['server_url'], + 'node_name': util.get_cfg_option_str(chef_cfg, 'node_name', + cloud.datasource.get_instance_id()), + 'environment': util.get_cfg_option_str(chef_cfg, 'environment', + '_default'), + 'validation_name': chef_cfg['validation_name']}) # set the firstboot json with open('/etc/chef/firstboot.json', 'w') as firstboot_json_fh: @@ -64,7 +65,8 @@ def handle(_name, cfg, cloud, log, _args): # If chef is not installed, we install chef based on 'install_type' if not os.path.isfile('/usr/bin/chef-client'): - install_type = util.get_cfg_option_str(chef_cfg, 'install_type', 'packages') + install_type = util.get_cfg_option_str(chef_cfg, 'install_type', + 'packages') if install_type == "gems": # this will install and run the chef-client from gems chef_version = util.get_cfg_option_str(chef_cfg, 'version', None) @@ -73,7 +75,8 @@ def handle(_name, cfg, cloud, log, _args): install_chef_from_gems(ruby_version, chef_version) # and finally, run chef-client log.debug('running chef-client') - subprocess.check_call(['/usr/bin/chef-client', '-d', '-i', '1800', '-s', '20']) + subprocess.check_call(['/usr/bin/chef-client', '-d', '-i', '1800', + '-s', '20']) else: # this will install and run the chef-client from packages cc.install_packages(('chef',)) |