示例#1
0
 def addUser(self, username='', password='', admin=False):
     # default is not admin
     if admin:
         return BASESSHV2.addUser(
             self,
             username=username,
             password=password,
             addCommand=
             'user {username} password {password} role network-admin\n')
     else:
         return BASESSHV2.addUser(
             self,
             username=username,
             password=password,
             addCommand='user {username} password {password} role priv-1\n')
示例#2
0
 def changePassword(self, username='', password=''):
     return BASESSHV2.addUser(
         self,
         username=username,
         password=password,
         addCommand=
         'user {username} password {password} role network-admin\n')
示例#3
0
 def _configMode(self):
         return BASESSHV2._configMode(self,"""sys\naaa""")
示例#4
0
 def changePassword(self, username='', password=''):
     return BASESSHV2.addUser(
         self,
         username=username,
         password=password,
         addCommand='username {username} secret {password}\n')
示例#5
0
 def _commit(self):
     return BASESSHV2._commit(
         self,
         saveCommand='copy running-config startup-config',
         exitCommand='end')
示例#6
0
 def addUser(self,username = '',password = ''):
         return BASESSHV2.addUser(self,username = username,password = password,addCommand = 'username {username} password {password}\n')