Exemple #1
0
 def __init__(self, *args, **kwargs):
     super(UnityDriver, self).__init__(*args, **kwargs)
     self.configuration.append_config_values(UNITY_OPTS)
     self.configuration.append_config_values(san_opts)
     protocol = self.configuration.storage_protocol
     if protocol.lower() == adapter.PROTOCOL_FC.lower():
         self.protocol = adapter.PROTOCOL_FC
         self.adapter = adapter.FCAdapter(self.VERSION)
     else:
         self.protocol = adapter.PROTOCOL_ISCSI
         self.adapter = adapter.ISCSIAdapter(self.VERSION)
Exemple #2
0
def init_adapter(version, protocol):
    if protocol == unity_adapter.PROTOCOL_FC:
        return unity_adapter.FCAdapter(version)
    return unity_adapter.ISCSIAdapter(version)