예제 #1
0
    def test_set_client(self):
        # The base class is abstract, so we'll use a subclass to test
        # base class functionality.
        helper = nfs_cmode.NetAppCmodeNFSHelper()
        self.assertIsNone(helper._client)

        helper.set_client('fake_client')
        self.assertEqual('fake_client', helper._client)
예제 #2
0
    def _get_helper(self, share):
        """Returns driver which implements share protocol."""
        share_protocol = share['share_proto'].lower()

        if share_protocol not in self.SUPPORTED_PROTOCOLS:
            err_msg = _("Invalid NAS protocol supplied: %s.") % share_protocol
            raise exception.NetAppException(err_msg)

        self._check_license_for_protocol(share_protocol)

        if share_protocol == 'nfs':
            return nfs_cmode.NetAppCmodeNFSHelper()
        elif share_protocol == 'cifs':
            return cifs_cmode.NetAppCmodeCIFSHelper()
예제 #3
0
 def _setup_helpers(self):
     """Initializes protocol-specific NAS drivers."""
     self._helpers = {
         'CIFS': cifs_cmode.NetAppCmodeCIFSHelper(),
         'NFS': nfs_cmode.NetAppCmodeNFSHelper()
     }