jp: profile session can now be started without connection:

- a new need_connect option is used when during BaseCommand init
    - if need_connect is True, profile connection is necessary, so use_profile must be True too
    - if need_connect if False, session can be started without connection, use_profile must be True
    - if need_connect is None, use_profile can be True (need_connect will be set to True) or False (need_connect is not used)
    - if need_connect is False (and so use_profile is True), a new --start-session option is usable
    - param get and set are the first commands to use this option, so parameters can be changed if connection is not working
This commit is contained in:
Goffi 2015-11-14 19:18:10 +01:00
commit 22696ec80b

View file

@ -26,7 +26,7 @@ __commands__ = ["Param"]
class Get(base.CommandBase):
def __init__(self, host):
super(Get, self).__init__(host, 'get', help=_('Get a parameter value'))
super(Get, self).__init__(host, 'get', need_connect=False, help=_('Get a parameter value'))
def add_parser_options(self):
self.parser.add_argument("category", nargs='?', type=base.unicode_decoder, help=_(u"Category of the parameter"))
@ -59,7 +59,7 @@ class Get(base.CommandBase):
class Set(base.CommandBase):
def __init__(self, host):
super(Set, self).__init__(host, 'set', help=_('Set a parameter value'))
super(Set, self).__init__(host, 'set', need_connect=False, help=_('Set a parameter value'))
def add_parser_options(self):
self.parser.add_argument("category", type=base.unicode_decoder, help=_(u"Category of the parameter"))