From 38f913377554f27159171a505b5805ee2537a905 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 12 Jan 2012 16:55:45 +0100 Subject: [PATCH 10/13] Fix pylint warnings W0102 (dangerous default value as From: Juerg Haefliger argument) --- cloudinit/CloudConfig/__init__.py | 6 ++++-- cloudinit/CloudConfig/cc_apt_update_upgrade.py | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'cloudinit/CloudConfig') 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: -- cgit v1.2.3