From b39248132e8a20140b5468ca0785bfcafc149b5b Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 10 Sep 2013 22:10:29 -0700 Subject: [PATCH] add more func aliases to avoid shadowing built-ins --- salt/modules/lxc.py | 7 ++++++- salt/modules/seed.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/salt/modules/lxc.py b/salt/modules/lxc.py index 74cbede6ca..7290b9d841 100644 --- a/salt/modules/lxc.py +++ b/salt/modules/lxc.py @@ -15,6 +15,11 @@ import salt.utils # Set up logging log = logging.getLogger(__name__) +# Don't shadow built-in's. +__func_alias__ = { + 'list_': 'list' +} + def __virtual__(): if not salt.utils.which('lxc'): @@ -217,7 +222,7 @@ def create(name, config=None, profile=None, options=None, **kwargs): return {'created': False, 'error': 'container could not be created'} -def list(): +def list_(): ''' List defined containers (running, stopped, and frozen). diff --git a/salt/modules/seed.py b/salt/modules/seed.py index 7c263cf78a..5917bf2622 100644 --- a/salt/modules/seed.py +++ b/salt/modules/seed.py @@ -19,6 +19,11 @@ import salt.config # Set up logging log = logging.getLogger(__name__) +# Don't shadow built-in's. +__func_alias__ = { + 'apply_': 'apply' +} + def _mount(path, ftype): mpt = None @@ -44,7 +49,7 @@ def _umount(mpt, ftype): __salt__['img.umount_image'](mpt) -def apply(path, id_=None, config=None, approve_key=True, install=True): +def apply_(path, id_=None, config=None, approve_key=True, install=True): ''' Seed a location (disk image, directory, or block device) with the minion config, approve the minion's key, and/or install salt-minion.