Remove unused code
There is no call to yum_base using 'cachedir' argument, so while it work fine from a cursory look, that's useless code, and so should be removed to clarify the code.
This commit is contained in:
parent
2dfc7122af
commit
b154bf967e
1 changed files with 1 additions and 9 deletions
|
@ -150,21 +150,13 @@ def log(msg):
|
||||||
syslog.openlog('ansible-yum', 0, syslog.LOG_USER)
|
syslog.openlog('ansible-yum', 0, syslog.LOG_USER)
|
||||||
syslog.syslog(syslog.LOG_NOTICE, msg)
|
syslog.syslog(syslog.LOG_NOTICE, msg)
|
||||||
|
|
||||||
def yum_base(conf_file=None, cachedir=False):
|
def yum_base(conf_file=None):
|
||||||
|
|
||||||
my = yum.YumBase()
|
my = yum.YumBase()
|
||||||
my.preconf.debuglevel=0
|
my.preconf.debuglevel=0
|
||||||
my.preconf.errorlevel=0
|
my.preconf.errorlevel=0
|
||||||
if conf_file and os.path.exists(conf_file):
|
if conf_file and os.path.exists(conf_file):
|
||||||
my.preconf.fn = conf_file
|
my.preconf.fn = conf_file
|
||||||
if cachedir or os.geteuid() != 0:
|
|
||||||
if hasattr(my, 'setCacheDir'):
|
|
||||||
my.setCacheDir()
|
|
||||||
else:
|
|
||||||
cachedir = yum.misc.getCacheDir()
|
|
||||||
my.repos.setCacheDir(cachedir)
|
|
||||||
my.conf.cache = 0
|
|
||||||
|
|
||||||
return my
|
return my
|
||||||
|
|
||||||
def install_yum_utils(module):
|
def install_yum_utils(module):
|
||||||
|
|
Loading…
Reference in a new issue