Prefix utils.get_root_helper with underscore
This function is internal to `utils` so should be begin with an underscore to clarify that it's private. Change-Id: I6fdb0c7d46867347d74b79ec1ed5749ef597258a
This commit is contained in:
@@ -166,21 +166,21 @@ def vpn_ping(address, port, timeout=0.05, session_id=None):
|
||||
return server_sess
|
||||
|
||||
|
||||
def get_root_helper():
|
||||
def _get_root_helper():
|
||||
return 'sudo nova-rootwrap %s' % CONF.rootwrap_config
|
||||
|
||||
|
||||
def execute(*cmd, **kwargs):
|
||||
"""Convenience wrapper around oslo's execute() method."""
|
||||
if 'run_as_root' in kwargs and not 'root_helper' in kwargs:
|
||||
kwargs['root_helper'] = get_root_helper()
|
||||
kwargs['root_helper'] = _get_root_helper()
|
||||
return processutils.execute(*cmd, **kwargs)
|
||||
|
||||
|
||||
def trycmd(*args, **kwargs):
|
||||
"""Convenience wrapper around oslo's trycmd() method."""
|
||||
if 'run_as_root' in kwargs and not 'root_helper' in kwargs:
|
||||
kwargs['root_helper'] = get_root_helper()
|
||||
kwargs['root_helper'] = _get_root_helper()
|
||||
return processutils.trycmd(*args, **kwargs)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user