示例#1
0
文件: cli.py 项目: optionalg/storops
    def get_connection_port(self, sp=None, port_id=None, vport_id=None):
        cmd = 'connection -getport -all'.split()
        if sp is not None:
            cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]

        cmd += int_var('-portid', port_id)
        if port_id is not None:
            cmd += int_var('-vportid', vport_id)

        return cmd
示例#2
0
    def delete_iscsi_ip(self, sp, port_id, vport_id=None):
        if vport_id is None:
            vport_id = 0

        cmd = ['connection', '-delport']
        cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]
        cmd += int_var('-portid', port_id)
        cmd += int_var('-vportid', vport_id)
        cmd.append('-o')
        return cmd
示例#3
0
    def get_connection_port(self, sp=None, port_id=None, vport_id=None):
        cmd = 'connection -getport -all'.split()
        if sp is not None:
            cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]

        cmd += int_var('-portid', port_id)
        if port_id is not None:
            cmd += int_var('-vportid', vport_id)

        return cmd
示例#4
0
    def delete_iscsi_ip(self, sp, port_id, vport_id=None):
        if vport_id is None:
            vport_id = 0

        cmd = ['connection', '-delport']
        cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]
        cmd += int_var('-portid', port_id)
        cmd += int_var('-vportid', vport_id)
        cmd.append('-o')
        return cmd
示例#5
0
    def set_path(self, sg_name, hba_uid, sp, port_id, ip, host, vport_id=None):

        cmd = ['storagegroup', '-setpath']
        cmd += text_var('-gname', sg_name)
        cmd += text_var('-hbauid', hba_uid)
        cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]
        cmd += int_var('-spport', port_id)
        cmd += int_var('-spvport', vport_id)
        cmd += text_var('-ip', ip)
        cmd += text_var('-host', host)
        cmd.append('-o')
        return cmd
示例#6
0
文件: cli.py 项目: optionalg/storops
    def set_path(self, sg_name, hba_uid, sp, port_id,
                 ip, host, vport_id=None):

        cmd = ['storagegroup', '-setpath']
        cmd += text_var('-gname', sg_name)
        cmd += text_var('-hbauid', hba_uid)
        cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]
        cmd += int_var('-spport', port_id)
        cmd += int_var('-spvport', vport_id)
        cmd += ['-ip', ip]
        cmd += text_var('-host', host)
        cmd.append('-o')
        return cmd
示例#7
0
 def ping_node(self, address, sp, port_id, vport_id=None, packet_size=None,
               count=None, timeout=None, delay=None):
     if vport_id is None:
         vport_id = 0
     cmd = ['connection', '-pingnode']
     sp = VNXSPEnum.get_sp_index(sp)
     cmd += text_var('-sp', sp)
     cmd += int_var('-portid', port_id)
     cmd += int_var('-vportid', vport_id)
     cmd += text_var('-address', address)
     cmd += int_var('-packetSize', packet_size)
     cmd += int_var('-count', count)
     cmd += int_var('-timeout', timeout)
     cmd += int_var('-delay', delay)
     return cmd
示例#8
0
    def config_iscsi_ip(self, sp, port_id, ip, netmask, gateway,
                        vport_id=None, vlan_id=None):
        if vport_id is None:
            vport_id = 0

        cmd = ['connection', '-setport', '-iscsi']
        cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]
        cmd += int_var('-portid', port_id)
        cmd += int_var('-vportid', vport_id)
        cmd += int_var('-vlanid', vlan_id)
        cmd += text_var('-address', ip)
        cmd += text_var('-subnetmask', netmask)
        cmd += text_var('-gateway', gateway)
        cmd.append('-o')
        return cmd
示例#9
0
    def config_iscsi_ip(self,
                        sp,
                        port_id,
                        ip,
                        netmask,
                        gateway,
                        vport_id=None,
                        vlan_id=None):
        if vport_id is None:
            vport_id = 0

        cmd = ['connection', '-setport', '-iscsi']
        cmd += ['-sp', VNXSPEnum.get_sp_index(sp)]
        cmd += int_var('-portid', port_id)
        cmd += int_var('-vportid', vport_id)
        cmd += int_var('-vlanid', vlan_id)
        cmd += text_var('-address', ip)
        cmd += text_var('-subnetmask', netmask)
        cmd += text_var('-gateway', gateway)
        cmd.append('-o')
        return cmd
示例#10
0
 def ping_node(self,
               address,
               sp,
               port_id,
               vport_id=None,
               packet_size=None,
               count=None,
               timeout=None,
               delay=None):
     if vport_id is None:
         vport_id = 0
     cmd = ['connection', '-pingnode']
     sp = VNXSPEnum.get_sp_index(sp)
     cmd += text_var('-sp', sp)
     cmd += int_var('-portid', port_id)
     cmd += int_var('-vportid', vport_id)
     cmd += text_var('-address', address)
     cmd += int_var('-packetSize', packet_size)
     cmd += int_var('-count', count)
     cmd += int_var('-timeout', timeout)
     cmd += int_var('-delay', delay)
     return cmd
示例#11
0
文件: port.py 项目: crook/storops
 def get_sp_index(self):
     return VNXSPEnum.get_sp_index(self.sp)
示例#12
0
 def test_get_sp_index(self):
     assert_that(VNXSPEnum.get_sp_index('spa'), equal_to('a'))
示例#13
0
 def f():
     VNXSPEnum.get_sp_index('abc')
示例#14
0
文件: port.py 项目: rtjust/storops
 def get_sp_index(self):
     return VNXSPEnum.get_sp_index(self.sp)
示例#15
0
文件: cli.py 项目: optionalg/storops
 def sp_network_status(self, sp):
     sp = VNXSPEnum.get_sp_index(sp)
     return 'networkadmin -get -sp {} -all'.format(sp).split()
示例#16
0
 def sp_network_status(self, sp):
     sp = VNXSPEnum.get_sp_index(sp)
     return 'networkadmin -get -sp {} -all'.format(sp).split()