diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-01-12 16:55:45 +0100 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-01-12 16:55:45 +0100 |
commit | 38f913377554f27159171a505b5805ee2537a905 (patch) | |
tree | d700c8cde638f7ae26a2facfc414f826305bad5b /cloudinit/CloudConfig | |
parent | 8b795f21caa5758138bb19a4f0412b80b6db9c99 (diff) | |
download | vyos-cloud-init-38f913377554f27159171a505b5805ee2537a905.tar.gz vyos-cloud-init-38f913377554f27159171a505b5805ee2537a905.zip |
[PATCH 10/13] Fix pylint warnings W0102 (dangerous default value as
From: Juerg Haefliger <juerg.haefliger@hp.com>
argument)
Diffstat (limited to 'cloudinit/CloudConfig')
-rw-r--r-- | cloudinit/CloudConfig/__init__.py | 6 | ||||
-rw-r--r-- | cloudinit/CloudConfig/cc_apt_update_upgrade.py | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cloudinit/CloudConfig/__init__.py b/cloudinit/CloudConfig/__init__.py index 82f422fc..f5c4143c 100644 --- a/cloudinit/CloudConfig/__init__.py +++ b/cloudinit/CloudConfig/__init__.py @@ -33,7 +33,7 @@ class CloudConfig(): cfgfile = None cfg = None - def __init__(self,cfgfile, cloud=None, ds_deps=[]): + def __init__(self,cfgfile, cloud=None, ds_deps=None): if cloud == None: self.cloud = cloudinit.CloudInit(ds_deps) self.cloud.get_data_source() @@ -233,7 +233,9 @@ def run_per_instance(name, func, args, clear_on_fail=False): raise # apt_get top level command (install, update...), and args to pass it -def apt_get(tlc,args=[]): +def apt_get(tlc,args=None): + if args is None: + args = [] e=os.environ.copy() e['DEBIAN_FRONTEND']='noninteractive' cmd=[ 'apt-get', diff --git a/cloudinit/CloudConfig/cc_apt_update_upgrade.py b/cloudinit/CloudConfig/cc_apt_update_upgrade.py index d466f3c4..0cbe02d4 100644 --- a/cloudinit/CloudConfig/cc_apt_update_upgrade.py +++ b/cloudinit/CloudConfig/cc_apt_update_upgrade.py @@ -131,7 +131,9 @@ def generate_sources_list(codename, mirror): # srclist is a list of dictionaries, # each entry must have: 'source' # may have: key, ( keyid and keyserver) -def add_sources(srclist, searchList={ }): +def add_sources(srclist, searchList=None): + if searchList is None: + searchList = {} elst = [] for ent in srclist: |