allow overriding argv and progname
this will be used by the comming 'ryu' command. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
186da7eb78
commit
e88529f966
@ -52,12 +52,14 @@ CONF.register_cli_opts([
|
||||
])
|
||||
|
||||
|
||||
def main():
|
||||
def main(args=None, prog=None):
|
||||
try:
|
||||
CONF(project='ryu', version='ryu-manager %s' % version,
|
||||
CONF(args=args, prog=prog,
|
||||
project='ryu', version='ryu-manager %s' % version,
|
||||
default_config_files=['/usr/local/etc/ryu/ryu.conf'])
|
||||
except cfg.ConfigFilesNotFoundError:
|
||||
CONF(project='ryu', version='ryu-manager %s' % version)
|
||||
CONF(args=args, prog=prog,
|
||||
project='ryu', version='ryu-manager %s' % version)
|
||||
|
||||
log.init_log()
|
||||
|
||||
|
@ -545,8 +545,9 @@ lost-connection-behavior failStandaloneMode
|
||||
self._in_onecmd = False
|
||||
|
||||
|
||||
def main():
|
||||
CONF(project='of-config-cli', version='of-config-cli')
|
||||
def main(args=None, prog=None):
|
||||
CONF(args=args, prog=prog,
|
||||
project='of-config-cli', version='of-config-cli')
|
||||
|
||||
for p_str in CONF.peers:
|
||||
name, addr = p_str.split('=')
|
||||
|
@ -222,8 +222,8 @@ class Cmd(cmd.Cmd):
|
||||
signal.alarm(self._notification_check_interval)
|
||||
|
||||
|
||||
def main():
|
||||
CONF(project='rpc-cli', version='rpc-cli')
|
||||
def main(args=None, prog=None):
|
||||
CONF(args=args, prog=prog, project='rpc-cli', version='rpc-cli')
|
||||
|
||||
for p_str in CONF.peers:
|
||||
name, addr = p_str.split('=')
|
||||
|
Loading…
Reference in New Issue
Block a user