diff options
| author | Scott Moser <smoser@ubuntu.com> | 2012-01-12 16:51:47 +0100 | 
|---|---|---|
| committer | Scott Moser <smoser@ubuntu.com> | 2012-01-12 16:51:47 +0100 | 
| commit | 234cefd314a7e1cfb51fad3bdf344d801a8b238d (patch) | |
| tree | dadad683214756e91e9a15c5ad88a9f89f8cf572 | |
| parent | df5d51c25523ea04d45f5f077e94885d1847e526 (diff) | |
| download | vyos-cloud-init-234cefd314a7e1cfb51fad3bdf344d801a8b238d.tar.gz vyos-cloud-init-234cefd314a7e1cfb51fad3bdf344d801a8b238d.zip | |
[PATCH 05/13] Fix pylint warnings W0613 (unused argument)
From: Juerg Haefliger <juerg.haefliger@hp.com>
32 files changed, 37 insertions, 37 deletions
| diff --git a/cloudinit/CloudConfig/cc_apt_update_upgrade.py b/cloudinit/CloudConfig/cc_apt_update_upgrade.py index 0677ceb5..e9fd2c07 100644 --- a/cloudinit/CloudConfig/cc_apt_update_upgrade.py +++ b/cloudinit/CloudConfig/cc_apt_update_upgrade.py @@ -22,7 +22,7 @@ import os  import glob  import cloudinit.CloudConfig as cc -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      update = util.get_cfg_option_bool(cfg, 'apt_update', False)      upgrade = util.get_cfg_option_bool(cfg, 'apt_upgrade', False) diff --git a/cloudinit/CloudConfig/cc_bootcmd.py b/cloudinit/CloudConfig/cc_bootcmd.py index 5a9e4356..fc925447 100644 --- a/cloudinit/CloudConfig/cc_bootcmd.py +++ b/cloudinit/CloudConfig/cc_bootcmd.py @@ -21,7 +21,7 @@ import tempfile  from cloudinit.CloudConfig import per_always  frequency = per_always -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      if not cfg.has_key("bootcmd"):          return diff --git a/cloudinit/CloudConfig/cc_byobu.py b/cloudinit/CloudConfig/cc_byobu.py index 406a1f67..dd510dda 100644 --- a/cloudinit/CloudConfig/cc_byobu.py +++ b/cloudinit/CloudConfig/cc_byobu.py @@ -19,7 +19,7 @@ import cloudinit.util as util  import subprocess  import traceback -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,args):      if len(args) != 0:          value = args[0]      else: diff --git a/cloudinit/CloudConfig/cc_chef.py b/cloudinit/CloudConfig/cc_chef.py index 08a9f40e..6b8e3825 100644 --- a/cloudinit/CloudConfig/cc_chef.py +++ b/cloudinit/CloudConfig/cc_chef.py @@ -23,7 +23,7 @@ import cloudinit.util as util  ruby_version_default = "1.8" -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      # If there isn't a chef key in the configuration don't do anything      if not cfg.has_key('chef'): return      chef_cfg = cfg['chef'] diff --git a/cloudinit/CloudConfig/cc_disable_ec2_metadata.py b/cloudinit/CloudConfig/cc_disable_ec2_metadata.py index 5cd1d1c1..f06d4dfc 100644 --- a/cloudinit/CloudConfig/cc_disable_ec2_metadata.py +++ b/cloudinit/CloudConfig/cc_disable_ec2_metadata.py @@ -21,7 +21,7 @@ from cloudinit.CloudConfig import per_always  frequency = per_always -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,_log,_args):      if util.get_cfg_option_bool(cfg, "disable_ec2_metadata", False):          fwall="route add -host 169.254.169.254 reject"          subprocess.call(fwall.split(' ')) diff --git a/cloudinit/CloudConfig/cc_final_message.py b/cloudinit/CloudConfig/cc_final_message.py index fbdb5c94..c8631d01 100644 --- a/cloudinit/CloudConfig/cc_final_message.py +++ b/cloudinit/CloudConfig/cc_final_message.py @@ -24,7 +24,7 @@ frequency = per_always  final_message = "cloud-init boot finished at $TIMESTAMP. Up $UPTIME seconds" -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,args):      if len(args) != 0:          msg_in = args[0]      else: diff --git a/cloudinit/CloudConfig/cc_foo.py b/cloudinit/CloudConfig/cc_foo.py index c15e8d75..48d20e5b 100644 --- a/cloudinit/CloudConfig/cc_foo.py +++ b/cloudinit/CloudConfig/cc_foo.py @@ -22,5 +22,5 @@ from cloudinit.CloudConfig import per_instance  frequency = per_instance -def handle(name,cfg,cloud,log,args): +def handle(_name,_cfg,_cloud,_log,_args):      print "hi" diff --git a/cloudinit/CloudConfig/cc_grub_dpkg.py b/cloudinit/CloudConfig/cc_grub_dpkg.py index 588f1403..97d79bdb 100644 --- a/cloudinit/CloudConfig/cc_grub_dpkg.py +++ b/cloudinit/CloudConfig/cc_grub_dpkg.py @@ -20,7 +20,7 @@ import cloudinit.util as util  import traceback  import os -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,_args):      idevs=None      idevs_empty=None diff --git a/cloudinit/CloudConfig/cc_keys_to_console.py b/cloudinit/CloudConfig/cc_keys_to_console.py index 79dd2ea9..08e8f085 100644 --- a/cloudinit/CloudConfig/cc_keys_to_console.py +++ b/cloudinit/CloudConfig/cc_keys_to_console.py @@ -21,7 +21,7 @@ import subprocess  frequency = per_instance -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,_args):      cmd = [ '/usr/lib/cloud-init/write-ssh-key-fingerprints' ]      fp_blacklist = util.get_cfg_option_list_or_str(cfg, "ssh_fp_console_blacklist", [])      key_blacklist = util.get_cfg_option_list_or_str(cfg, "ssh_key_console_blacklist", ["ssh-dss"]) diff --git a/cloudinit/CloudConfig/cc_landscape.py b/cloudinit/CloudConfig/cc_landscape.py index e3e4f7ba..22a90665 100644 --- a/cloudinit/CloudConfig/cc_landscape.py +++ b/cloudinit/CloudConfig/cc_landscape.py @@ -32,7 +32,7 @@ lsc_builtincfg = {    }  } -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,_args):      """      Basically turn a top level 'landscape' entry with a 'client' dict      and render it to ConfigObj format under '[client]' section in diff --git a/cloudinit/CloudConfig/cc_locale.py b/cloudinit/CloudConfig/cc_locale.py index 8542f641..8e91d3bf 100644 --- a/cloudinit/CloudConfig/cc_locale.py +++ b/cloudinit/CloudConfig/cc_locale.py @@ -28,7 +28,7 @@ def apply_locale(locale, cfgfile):      util.render_to_file('default-locale', cfgfile, { 'locale' : locale }) -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,args):      if len(args) != 0:          locale = args[0]      else: diff --git a/cloudinit/CloudConfig/cc_mcollective.py b/cloudinit/CloudConfig/cc_mcollective.py index 656dd406..38fe4a3c 100644 --- a/cloudinit/CloudConfig/cc_mcollective.py +++ b/cloudinit/CloudConfig/cc_mcollective.py @@ -38,7 +38,7 @@ class FakeSecHead(object):              finally: self.sechead = None          else: return self.fp.readline() -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,_log,_args):      # If there isn't a mcollective key in the configuration don't do anything      if not cfg.has_key('mcollective'): return      mcollective_cfg = cfg['mcollective'] diff --git a/cloudinit/CloudConfig/cc_mounts.py b/cloudinit/CloudConfig/cc_mounts.py index db382f04..327b480f 100644 --- a/cloudinit/CloudConfig/cc_mounts.py +++ b/cloudinit/CloudConfig/cc_mounts.py @@ -31,7 +31,7 @@ def is_mdname(name):              return True      return False -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      # fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno      defvals = [ None, None, "auto", "defaults,nobootwait", "0", "2" ]      defvals = cfg.get("mount_default_fields", defvals) diff --git a/cloudinit/CloudConfig/cc_phone_home.py b/cloudinit/CloudConfig/cc_phone_home.py index f291e1d4..3dcec17f 100644 --- a/cloudinit/CloudConfig/cc_phone_home.py +++ b/cloudinit/CloudConfig/cc_phone_home.py @@ -31,7 +31,7 @@ post_list_all = [ 'pub_key_dsa', 'pub_key_rsa', 'pub_key_ecdsa', 'instance_id',  #  url: http://my.foo.bar/$INSTANCE_ID/  #  post: [ pub_key_dsa, pub_key_rsa, pub_key_ecdsa, instance_id  #    -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,args):      if len(args) != 0:          ph_cfg = util.readconf(args[0])      else: diff --git a/cloudinit/CloudConfig/cc_puppet.py b/cloudinit/CloudConfig/cc_puppet.py index c635d1f5..3748559a 100644 --- a/cloudinit/CloudConfig/cc_puppet.py +++ b/cloudinit/CloudConfig/cc_puppet.py @@ -25,7 +25,7 @@ import ConfigParser  import cloudinit.CloudConfig as cc  import cloudinit.util as util -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      # If there isn't a puppet key in the configuration don't do anything      if not cfg.has_key('puppet'): return      puppet_cfg = cfg['puppet'] diff --git a/cloudinit/CloudConfig/cc_resizefs.py b/cloudinit/CloudConfig/cc_resizefs.py index 83062642..d4b260b8 100644 --- a/cloudinit/CloudConfig/cc_resizefs.py +++ b/cloudinit/CloudConfig/cc_resizefs.py @@ -25,7 +25,7 @@ from cloudinit.CloudConfig import per_always  frequency = per_always -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,args):      if len(args) != 0:          resize_root = False          if str(args[0]).lower() in [ 'true', '1', 'on', 'yes']: diff --git a/cloudinit/CloudConfig/cc_rightscale_userdata.py b/cloudinit/CloudConfig/cc_rightscale_userdata.py index ce0c2fe9..050d89aa 100644 --- a/cloudinit/CloudConfig/cc_rightscale_userdata.py +++ b/cloudinit/CloudConfig/cc_rightscale_userdata.py @@ -42,7 +42,7 @@ frequency = per_instance  my_name = "cc_rightscale_userdata"  my_hookname = 'CLOUD_INIT_REMOTE_HOOK' -def handle(name,cfg,cloud,log,args): +def handle(_name,_cfg,cloud,log,_args):      try:          ud = cloud.get_userdata_raw()      except: diff --git a/cloudinit/CloudConfig/cc_rsyslog.py b/cloudinit/CloudConfig/cc_rsyslog.py index dfd72c33..4e427ae0 100644 --- a/cloudinit/CloudConfig/cc_rsyslog.py +++ b/cloudinit/CloudConfig/cc_rsyslog.py @@ -24,7 +24,7 @@ import traceback  DEF_FILENAME = "20-cloud-config.conf"  DEF_DIR = "/etc/rsyslog.d" -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,_args):      # rsyslog:      #  - "*.* @@192.158.1.1"      #  - content: "*.*   @@192.0.2.1:10514" diff --git a/cloudinit/CloudConfig/cc_runcmd.py b/cloudinit/CloudConfig/cc_runcmd.py index 633f411b..d255223b 100644 --- a/cloudinit/CloudConfig/cc_runcmd.py +++ b/cloudinit/CloudConfig/cc_runcmd.py @@ -18,7 +18,7 @@  import cloudinit.util as util -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      if not cfg.has_key("runcmd"):          return      outfile="%s/runcmd" % cloud.get_ipath('scripts') diff --git a/cloudinit/CloudConfig/cc_scripts_per_boot.py b/cloudinit/CloudConfig/cc_scripts_per_boot.py index 2af060af..fb643c6d 100644 --- a/cloudinit/CloudConfig/cc_scripts_per_boot.py +++ b/cloudinit/CloudConfig/cc_scripts_per_boot.py @@ -23,7 +23,7 @@ from cloudinit import get_cpath  frequency = per_always  runparts_path = "%s/%s" % (get_cpath(), "scripts/per-boot") -def handle(name,cfg,cloud,log,args): +def handle(_name,_cfg,_cloud,log,_args):      try:          util.runparts(runparts_path)      except: diff --git a/cloudinit/CloudConfig/cc_scripts_per_instance.py b/cloudinit/CloudConfig/cc_scripts_per_instance.py index e00f5e7b..b0f0601a 100644 --- a/cloudinit/CloudConfig/cc_scripts_per_instance.py +++ b/cloudinit/CloudConfig/cc_scripts_per_instance.py @@ -23,7 +23,7 @@ from cloudinit import get_cpath  frequency = per_instance  runparts_path = "%s/%s" % (get_cpath(), "scripts/per-instance") -def handle(name,cfg,cloud,log,args): +def handle(_name,_cfg,_cloud,log,_args):      try:          util.runparts(runparts_path)      except: diff --git a/cloudinit/CloudConfig/cc_scripts_per_once.py b/cloudinit/CloudConfig/cc_scripts_per_once.py index 3c1a151b..2ab81840 100644 --- a/cloudinit/CloudConfig/cc_scripts_per_once.py +++ b/cloudinit/CloudConfig/cc_scripts_per_once.py @@ -23,7 +23,7 @@ from cloudinit import get_cpath  frequency = per_once  runparts_path = "%s/%s" % (get_cpath(), "scripts/per-once") -def handle(name,cfg,cloud,log,args): +def handle(_name,_cfg,_cloud,log,_args):      try:          util.runparts(runparts_path)      except: diff --git a/cloudinit/CloudConfig/cc_scripts_user.py b/cloudinit/CloudConfig/cc_scripts_user.py index 2f44b66b..9c7f2322 100644 --- a/cloudinit/CloudConfig/cc_scripts_user.py +++ b/cloudinit/CloudConfig/cc_scripts_user.py @@ -23,7 +23,7 @@ from cloudinit import get_ipath_cur  frequency = per_instance  runparts_path = "%s/%s" % (get_ipath_cur(), "scripts") -def handle(name,cfg,cloud,log,args): +def handle(_name,_cfg,_cloud,log,_args):      try:          util.runparts(runparts_path)      except: diff --git a/cloudinit/CloudConfig/cc_set_hostname.py b/cloudinit/CloudConfig/cc_set_hostname.py index 1a70d9e0..129e9165 100644 --- a/cloudinit/CloudConfig/cc_set_hostname.py +++ b/cloudinit/CloudConfig/cc_set_hostname.py @@ -18,7 +18,7 @@  import cloudinit.util as util -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      if util.get_cfg_option_bool(cfg,"preserve_hostname",False):          log.debug("preserve_hostname is set. not setting hostname")          return(True) diff --git a/cloudinit/CloudConfig/cc_set_passwords.py b/cloudinit/CloudConfig/cc_set_passwords.py index c7fa4d64..f44d450c 100644 --- a/cloudinit/CloudConfig/cc_set_passwords.py +++ b/cloudinit/CloudConfig/cc_set_passwords.py @@ -21,7 +21,7 @@ import sys  import random  import string -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,args):      if len(args) != 0:          # if run from command line, and give args, wipe the chpasswd['list']          password = args[0] diff --git a/cloudinit/CloudConfig/cc_ssh.py b/cloudinit/CloudConfig/cc_ssh.py index 9f5dc567..0aad2187 100644 --- a/cloudinit/CloudConfig/cc_ssh.py +++ b/cloudinit/CloudConfig/cc_ssh.py @@ -26,7 +26,7 @@ DISABLE_ROOT_OPTS="no-port-forwarding,no-agent-forwarding,no-X11-forwarding,comm  global_log = None -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      global global_log      global_log = log diff --git a/cloudinit/CloudConfig/cc_ssh_import_id.py b/cloudinit/CloudConfig/cc_ssh_import_id.py index bf1314be..7e7a54a1 100644 --- a/cloudinit/CloudConfig/cc_ssh_import_id.py +++ b/cloudinit/CloudConfig/cc_ssh_import_id.py @@ -19,7 +19,7 @@ import cloudinit.util as util  import subprocess  import traceback -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,args):      if len(args) != 0:          user = args[0]          ids = [ ] diff --git a/cloudinit/CloudConfig/cc_timezone.py b/cloudinit/CloudConfig/cc_timezone.py index 9a6e50d1..26b2796d 100644 --- a/cloudinit/CloudConfig/cc_timezone.py +++ b/cloudinit/CloudConfig/cc_timezone.py @@ -24,7 +24,7 @@ import shutil  frequency = per_instance  tz_base = "/usr/share/zoneinfo" -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,_cloud,log,args):      if len(args) != 0:          timezone = args[0]      else: diff --git a/cloudinit/CloudConfig/cc_update_etc_hosts.py b/cloudinit/CloudConfig/cc_update_etc_hosts.py index cf2ad046..9e3a1dbb 100644 --- a/cloudinit/CloudConfig/cc_update_etc_hosts.py +++ b/cloudinit/CloudConfig/cc_update_etc_hosts.py @@ -21,7 +21,7 @@ import StringIO  frequency = per_always -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      ( hostname, fqdn ) = util.get_hostname_fqdn(cfg, cloud)      manage_hosts = util.get_cfg_option_bool(cfg,"manage_etc_hosts", False) @@ -48,7 +48,7 @@ def handle(name,cfg,cloud,log,args):              log.debug("not managing /etc/hosts") -def update_etc_hosts(hostname, fqdn, log): +def update_etc_hosts(hostname, fqdn, _log):      with open('/etc/hosts', 'r') as etchosts:          header = "# Added by cloud-init\n"          hosts_line = "127.0.1.1\t%s %s\n" % (fqdn, hostname) diff --git a/cloudinit/CloudConfig/cc_update_hostname.py b/cloudinit/CloudConfig/cc_update_hostname.py index 3f55c73b..871e40bf 100644 --- a/cloudinit/CloudConfig/cc_update_hostname.py +++ b/cloudinit/CloudConfig/cc_update_hostname.py @@ -22,7 +22,7 @@ from cloudinit.CloudConfig import per_always  frequency = per_always -def handle(name,cfg,cloud,log,args): +def handle(_name,cfg,cloud,log,_args):      if util.get_cfg_option_bool(cfg,"preserve_hostname",False):          log.debug("preserve_hostname is set. not updating hostname")          return diff --git a/cloudinit/DataSource.py b/cloudinit/DataSource.py index 06061a2e..66763181 100644 --- a/cloudinit/DataSource.py +++ b/cloudinit/DataSource.py @@ -82,7 +82,7 @@ class DataSource:          return(keys) -    def device_name_to_device(self, name): +    def device_name_to_device(self, _name):          # translate a 'name' to a device          # the primary function at this point is on ec2          # to consult metadata service, that has diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index d01d443d..5460d6e1 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -365,7 +365,7 @@ class CloudInit:                  continue              handler_call_end(mod, data, frequency) -    def handle_user_script(self,data,ctype,filename,payload, frequency): +    def handle_user_script(self,_data,ctype,filename,payload, _frequency):          if ctype == "__end__": return          if ctype == "__begin__":              # maybe delete existing things here @@ -376,7 +376,7 @@ class CloudInit:          util.write_file("%s/%s" %               (scriptsdir,filename), util.dos2unix(payload), 0700) -    def handle_upstart_job(self,data,ctype,filename,payload, frequency): +    def handle_upstart_job(self,_data,ctype,filename,payload, frequency):          # upstart jobs are only written on the first boot          if frequency != per_instance:              return @@ -388,7 +388,7 @@ class CloudInit:          util.write_file("%s/%s" % ("/etc/init",filename),              util.dos2unix(payload), 0644) -    def handle_cloud_config(self,data,ctype,filename,payload, frequency): +    def handle_cloud_config(self,_data,ctype,filename,payload, _frequency):          if ctype == "__begin__":              self.cloud_config_str=""              return @@ -408,7 +408,7 @@ class CloudInit:          self.cloud_config_str+="\n#%s\n%s" % (filename,payload) -    def handle_cloud_boothook(self,data,ctype,filename,payload, frequency): +    def handle_cloud_boothook(self,_data,ctype,filename,payload, _frequency):          if ctype == "__end__": return          if ctype == "__begin__": return @@ -538,7 +538,7 @@ def handler_handle_part(mod, data, ctype, filename, payload, frequency):      else:          mod.handle_part(data, ctype, filename, payload, frequency) -def partwalker_handle_handler(pdata, ctype, filename, payload): +def partwalker_handle_handler(pdata, _ctype, _filename, payload):      curcount = pdata['handlercount']      modname  = 'part-handler-%03d' % curcount | 
