HP 10500 Series Configuration Manual page 304

Hide thumbs Also See for 10500 Series:
Table of Contents

Advertisement

Parameters
command: Specifies the commands to be executed. To enter multiple commands, use a space and a
semicolon (;) as the delimiter. To enter a command in a view other than user view, you must first enter the
commands used to enter the view. For example, you must enter 'system-view ;local-user test class
manage' to execute the local-user test class manage command.
do_print: Specifies whether to output the execution result:
True—Outputs the execution result. This value is the default.
False—Does not output the execution result.
Returns
CLI objects
Examples
# Add a local user with the username test.
<Sysname> python
Python 2.7.3 (default, May 24 2013, 14:37:26)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import comware
>>> comware.CLI('system-view ;local-user test class manage')
Sample output
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] local-user test class manage
New local user added.
<comware.CLI object at 0x555580a0f0>
get_output
Use get_output to get the output from executed commands.
Syntax
CLI.get_output()
Returns
Output from executed commands
Examples
# Add a local user and get the output from the command.
<Sysname> python
Python 2.7.3 (default, May 24 2013, 14:37:26)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import comware
>>> c = comware.CLI('system-view ;local-user test class manage', False)
>>> c.get_output()
Sample output
['<Sysname>system-view', 'System View: return to User View with Ctrl+Z.',
'[Sysname]local-user test class manage', 'New local user added.']
294

Advertisement

Table of Contents
loading

Table of Contents