1. Adjust the logging of phone home module when its not enabled
2. Fix pylint warning in userdata about unused variable
This commit is contained in:
parent
3ed847593b
commit
8e5a6aded8
@ -49,6 +49,8 @@ def handle(name, cfg, cloud, log, args):
|
|||||||
ph_cfg = util.read_conf(args[0])
|
ph_cfg = util.read_conf(args[0])
|
||||||
else:
|
else:
|
||||||
if not 'phone_home' in cfg:
|
if not 'phone_home' in cfg:
|
||||||
|
log.debug(("Skipping module named %s, "
|
||||||
|
"no 'phone_home' configuration found"), name)
|
||||||
return
|
return
|
||||||
ph_cfg = cfg['phone_home']
|
ph_cfg = cfg['phone_home']
|
||||||
|
|
||||||
@ -59,7 +61,7 @@ def handle(name, cfg, cloud, log, args):
|
|||||||
|
|
||||||
url = ph_cfg['url']
|
url = ph_cfg['url']
|
||||||
post_list = ph_cfg.get('post', 'all')
|
post_list = ph_cfg.get('post', 'all')
|
||||||
tries = ph_cfg.get('tries', 10)
|
tries = ph_cfg.get('tries')
|
||||||
try:
|
try:
|
||||||
tries = int(tries)
|
tries = int(tries)
|
||||||
except:
|
except:
|
||||||
|
@ -204,7 +204,7 @@ class UserDataProcessor(object):
|
|||||||
outer_msg.replace_header(ATTACHMENT_FIELD, str(fetched_count))
|
outer_msg.replace_header(ATTACHMENT_FIELD, str(fetched_count))
|
||||||
return fetched_count
|
return fetched_count
|
||||||
|
|
||||||
def _part_filename(self, unnamed_part, count):
|
def _part_filename(self, _unnamed_part, count):
|
||||||
return PART_FN_TPL % (count + 1)
|
return PART_FN_TPL % (count + 1)
|
||||||
|
|
||||||
def _attach_part(self, outer_msg, part):
|
def _attach_part(self, outer_msg, part):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user