reset_error_flg(cmd)
out = self.command[:-1] + 'ERROR' + '\nadmin:/>'
return out.replace('\n', '\r\n')
-
- if cmd == 'showsys':
- out = self.simu.cli_showsys(params)
- elif cmd == 'createlun':
- out = self.simu.cli_createlun(params)
- elif cmd == 'showlun':
- out = self.simu.cli_showlun(params)
- elif cmd == 'dellun':
- out = self.simu.cli_dellun(params)
- elif cmd == 'showrg':
- out = self.simu.cli_showrg(params)
- elif cmd == 'showpool':
- out = self.simu.cli_showpool(params)
- elif cmd == 'createluncopy':
- out = self.simu.cli_createluncopy(params)
- elif cmd == 'chgluncopystatus':
- out = self.simu.cli_chgluncopystatus(params)
- elif cmd == 'showluncopy':
- out = self.simu.cli_showluncopy(params)
- elif cmd == 'delluncopy':
- out = self.simu.cli_delluncopy(params)
- elif cmd == 'createsnapshot':
- out = self.simu.cli_createsnapshot(params)
- elif cmd == 'actvsnapshot':
- out = self.simu.cli_activesnapshot(params)
- elif cmd == 'showsnapshot':
- out = self.simu.cli_showsnapshot(params)
- elif cmd == 'disablesnapshot':
- out = self.simu.cli_disablesnapshot(params)
- elif cmd == 'delsnapshot':
- out = self.simu.cli_delsnapshot(params)
- elif cmd == 'showrespool':
- out = self.simu.cli_showrespool(params)
- elif cmd == 'showiscsitgtname':
- out = self.simu.cli_showiscsitgtname(params)
- elif cmd == 'showiscsiip':
- out = self.simu.cli_showiscsiip(params)
- elif cmd == 'showhostgroup':
- out = self.simu.cli_showhostgroup(params)
- elif cmd == 'createhostgroup':
- out = self.simu.cli_createhostgroup(params)
- elif cmd == 'showhost':
- out = self.simu.cli_showhost(params)
- elif cmd == 'addhost':
- out = self.simu.cli_addhost(params)
- elif cmd == 'delhost':
- out = self.simu.cli_delhost(params)
- elif cmd == 'showiscsiini':
- out = self.simu.cli_showiscsiini(params)
- elif cmd == 'addiscsiini':
- out = self.simu.cli_addiscsiini(params)
- elif cmd == 'deliscsiini':
- out = self.simu.cli_deliscsiini(params)
- elif cmd == 'showhostport':
- out = self.simu.cli_showhostport(params)
- elif cmd == 'addhostport':
- out = self.simu.cli_addhostport(params)
- elif cmd == 'delhostport':
- out = self.simu.cli_delhostport(params)
- elif cmd == 'showhostmap':
- out = self.simu.cli_showhostmap(params)
- elif cmd == 'addhostmap':
- out = self.simu.cli_addhostmap(params)
- elif cmd == 'delhostmap':
- out = self.simu.cli_delhostmap(params)
- elif cmd == 'showfreeport':
- out = self.simu.cli_showfreeport(params)
- elif cmd == 'showhostpath':
- out = self.simu.cli_showhostpath(params)
- elif cmd == 'chglun':
- out = self.simu.cli_chglun(params)
- elif cmd == 'showfcmode':
- out = self.simu.cli_showfcmode(params)
+ func_name = 'cli_' + cmd
+ cli_func = getattr(self.simu, func_name)
+ out = cli_func(params)
out = self.command[:-1] + out + '\nadmin:/>'
return out.replace('\n', '\r\n')
CLONED_LUN_INFO['Owner Controller'] = 'A'
CLONED_LUN_INFO['Worker Controller'] = 'A'
CLONED_LUN_INFO['RAID Group ID'] = POOL_SETTING['ID']
- CLONED_LUN_INFO['provider_location'] = CLONED_LUN_INFO['ID']
FAKE_CLONED_VOLUME['provider_location'] = CLONED_LUN_INFO['ID']
out = 'command operates successfully'
return out
""" % (SNAPSHOT_INFO['Name'], SNAPSHOT_INFO['ID'], SNAPSHOT_INFO['Status'])
return out
- def cli_activesnapshot(self, params):
+ def cli_actvsnapshot(self, params):
SNAPSHOT_INFO['Status'] = 'Active'
FAKE_SNAPSHOT['provider_location'] = SNAPSHOT_INFO['ID']
out = 'command operates successfully'
----------------------------------------------------------------------------
Controller ID Interface Module ID Port ID IP Address Mask
----------------------------------------------------------------------------
- N 0 P1 %s 255.255.255.0
+ B 0 P1 %s 255.255.255.0
============================================================================
-""" % INITIATOR_SETTING['Initiator TargetIP']
return out
LUN_INFO['RAID Group ID'], LUN_INFO['Owner Controller'],
LUN_INFO['Worker Controller'], LUN_INFO['Lun Type'],
LUN_INFO['SnapShot ID'], LUN_INFO['LunCopy ID'])
- if params[params.index('-lun')] == VOLUME_SNAP_ID['vol'] else
+ if params[params.index('-lun') + 1] == VOLUME_SNAP_ID['vol'] else
(CLONED_LUN_INFO['ID'], CLONED_LUN_INFO['Name'],
CLONED_LUN_INFO['Visible Capacity'], CLONED_LUN_INFO['RAID Group ID'],
CLONED_LUN_INFO['Owner Controller'],