Ejemplo n.º 1
0
def do_get_connector(client, args):
    """Get the connection properties for all protocols."""
    brickclient = brick_client.Client(client)
    connector = brickclient.get_connector(args.multipath,
                                          args.enforce_multipath,
                                          args.nic)
    utils.print_dict(connector)
Ejemplo n.º 2
0
def do_get_all_volume_paths(client, args):
    """Get all volume paths for a protocol."""
    brickclient = brick_client.Client(client)

    paths = brickclient.get_all_volume_paths(args.protocol, args.multipath)
    if paths:
        print('\n'.join(paths))
Ejemplo n.º 3
0
def do_get_volume_paths(client, args):
    """Get volume paths for a volume."""
    volume = args.identifier
    brickclient = brick_client.Client(client)

    paths = brickclient.get_volume_paths(volume, args.multipath)
    if paths:
        print('\n'.join(paths))
Ejemplo n.º 4
0
 def test_client_use_new_attach_v1_cinderclient(self,
                                                mock_semantic_version):
     self._init_fake_cinderclient('iscsi')
     mock_semantic_version.return_value = pbr_version.SemanticVersion(
         major=1, minor=0)
     self.client.volumes_client.version_info.semantic_version
     brick_client = client.Client(self.client.volumes_client)
     self.assertTrue(brick_client._use_legacy_attach)
Ejemplo n.º 5
0
def do_local_attach(client, args):
    hostname = args.hostname
    volume = args.identifier
    brickclient = brick_client.Client(client)
    device_info = brickclient.attach(volume, hostname, args.mountpoint,
                                     args.mode, args.multipath,
                                     args.enforce_multipath, args.nic)
    utils.print_dict(device_info)
Ejemplo n.º 6
0
def do_local_detach(client, args):
    volume = args.identifier
    brickclient = brick_client.Client(client)
    device_info = None
    if args.device_info:
        device_info = json.loads(args.device_info)

    brickclient.detach(volume, args.attachment_uuid, args.multipath,
                       args.enforce_multipath, device_info)
Ejemplo n.º 7
0
    def test_client_use_new_attach_v2_cinderclient_3_0(self,
                                                       mock_semantic_version):
        self._init_fake_cinderclient('iscsi')
        mock_semantic_version.return_value = pbr_version.SemanticVersion(
            major=2, minor=0)
        self.client.volumes_client.version_info.semantic_version
        current_api_version = api_versions.APIVersion("3.0")
        self.client.volumes_client.api_version = current_api_version
        brick_client = client.Client(self.client.volumes_client)

        self.assertTrue(brick_client._use_legacy_attach)
 def setUp(self):
     super(TestBrickClient, self).setUp()
     self.volume_id = '3d96b134-75bd-492b-8372-330455cae38f'
     self.hostname = 'hostname'
     self.client = client.Client()
Ejemplo n.º 9
0
 def test_client_use_new_attach_no_volumes_client(self):
     brick_client = client.Client(None)
     self.assertTrue(brick_client._use_legacy_attach)