-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into dependabot/go_modules/google.golang.org/g…
…rpc-1.56.3
- Loading branch information
Showing
45 changed files
with
4,597 additions
and
4,653 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,4 @@ updates: | |
labels: | ||
- github_actions | ||
- dependencies | ||
- testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
from collections import defaultdict | ||
from threading import RLock | ||
|
||
from controllers.common.csi_logger import get_stdout_logger | ||
|
||
logger = get_stdout_logger() | ||
|
||
|
||
class VolumeCacheByAddress: | ||
def __init__(self): | ||
logger.debug("creating a new cache") | ||
self._volume_cache_by_address = defaultdict(dict) | ||
self._cache_lock = RLock() | ||
|
||
def add(self, address, key, value): | ||
logger.debug("adding {} to cache".format(key)) | ||
with self._cache_lock: | ||
self._volume_cache_by_address[address][key] = value | ||
|
||
def remove(self, address, key): | ||
logger.debug("removing {} from cache".format(key)) | ||
with self._cache_lock: | ||
if self._volume_cache_by_address[address].get(key) is not None: | ||
del self._volume_cache_by_address[address][key] | ||
|
||
def get(self, address, key): | ||
logger.debug("getting {} from cache".format(key)) | ||
with self._cache_lock: | ||
return self._volume_cache_by_address[address].get(key) | ||
|
||
def add_or_delete(self, address, key, value): | ||
with self._cache_lock: | ||
if self._volume_cache_by_address[address].get(key) is None: | ||
logger.debug("adding {} to cache".format(key)) | ||
self._volume_cache_by_address[address][key] = value | ||
else: | ||
logger.debug("removing {} from cache".format(key)) | ||
del self._volume_cache_by_address[address][key] | ||
|
||
|
||
volume_cache_by_address = VolumeCacheByAddress() | ||
|
||
|
||
class VolumeCache: | ||
def __init__(self, service_address): | ||
self._service_address = service_address | ||
|
||
def add(self, key, value): | ||
volume_cache_by_address.add(self._service_address, key, value) | ||
|
||
def remove(self, key): | ||
volume_cache_by_address.remove(self._service_address, key) | ||
|
||
def get(self, key): | ||
return volume_cache_by_address.get(self._service_address, key) | ||
|
||
def add_or_delete(self, key, value): | ||
volume_cache_by_address.add_or_delete(self._service_address, key, value) | ||
from collections import defaultdict | ||
from threading import RLock | ||
|
||
from controllers.common.csi_logger import get_stdout_logger | ||
|
||
logger = get_stdout_logger() | ||
|
||
|
||
class VolumeCacheByAddress: | ||
def __init__(self): | ||
logger.debug("creating a new cache") | ||
self._volume_cache_by_address = defaultdict(dict) | ||
self._cache_lock = RLock() | ||
|
||
def add(self, address, key, value): | ||
logger.debug("adding {} to cache".format(key)) | ||
with self._cache_lock: | ||
self._volume_cache_by_address[address][key] = value | ||
|
||
def remove(self, address, key): | ||
logger.debug("removing {} from cache".format(key)) | ||
with self._cache_lock: | ||
if self._volume_cache_by_address[address].get(key) is not None: | ||
del self._volume_cache_by_address[address][key] | ||
|
||
def get(self, address, key): | ||
logger.debug("getting {} from cache".format(key)) | ||
with self._cache_lock: | ||
return self._volume_cache_by_address[address].get(key) | ||
|
||
def add_or_delete(self, address, key, value): | ||
with self._cache_lock: | ||
if self._volume_cache_by_address[address].get(key) is None: | ||
logger.debug("adding {} to cache".format(key)) | ||
self._volume_cache_by_address[address][key] = value | ||
else: | ||
logger.debug("removing {} from cache".format(key)) | ||
del self._volume_cache_by_address[address][key] | ||
|
||
|
||
volume_cache_by_address = VolumeCacheByAddress() | ||
|
||
|
||
class VolumeCache: | ||
def __init__(self, service_address): | ||
self._service_address = service_address | ||
|
||
def add(self, key, value): | ||
volume_cache_by_address.add(self._service_address, key, value) | ||
|
||
def remove(self, key): | ||
volume_cache_by_address.remove(self._service_address, key) | ||
|
||
def get(self, key): | ||
return volume_cache_by_address.get(self._service_address, key) | ||
|
||
def add_or_delete(self, key, value): | ||
volume_cache_by_address.add_or_delete(self._service_address, key, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
import encodings | ||
|
||
from controllers.array_action.settings import WWN_OUI_END, WWN_VENDOR_IDENTIFIER_END, VENDOR_IDENTIFIER_LENGTH, \ | ||
NGUID_OUI_END | ||
from controllers.common.csi_logger import get_stdout_logger | ||
|
||
UTF_8 = encodings.utf_8.getregentry().name | ||
|
||
logger = get_stdout_logger() | ||
|
||
|
||
def convert_scsi_id_to_nguid(volume_id): | ||
logger.debug("Converting scsi uuid : {} to nguid".format(volume_id)) | ||
oui = volume_id[1:WWN_OUI_END] | ||
vendor_identifier = volume_id[WWN_OUI_END:WWN_VENDOR_IDENTIFIER_END] | ||
vendor_identifier_extension = volume_id[WWN_VENDOR_IDENTIFIER_END:] | ||
final_nguid = ''.join((vendor_identifier_extension, oui, '0', vendor_identifier)) | ||
logger.debug("Nguid is : {}".format(final_nguid)) | ||
return final_nguid | ||
|
||
|
||
def convert_nguid_to_scsi_id(volume_id): | ||
logger.debug("Converting nguid : {} to scsi uuid".format(volume_id)) | ||
oui = volume_id[WWN_VENDOR_IDENTIFIER_END:NGUID_OUI_END] | ||
vendor_identifier = volume_id[-VENDOR_IDENTIFIER_LENGTH:] | ||
vendor_identifier_extension = volume_id[:WWN_VENDOR_IDENTIFIER_END] | ||
final_scsi_id = ''.join((oui, vendor_identifier, vendor_identifier_extension)) | ||
logger.debug("scsi uuid is : {}".format(final_scsi_id)) | ||
return final_scsi_id | ||
|
||
|
||
class ClassProperty: | ||
|
||
def __init__(self, function): | ||
self._function = function | ||
|
||
def __get__(self, instance, owner): | ||
return self._function(owner) | ||
import encodings | ||
|
||
from controllers.array_action.settings import WWN_OUI_END, WWN_VENDOR_IDENTIFIER_END, VENDOR_IDENTIFIER_LENGTH, \ | ||
NGUID_OUI_END | ||
from controllers.common.csi_logger import get_stdout_logger | ||
|
||
UTF_8 = encodings.utf_8.getregentry().name | ||
|
||
logger = get_stdout_logger() | ||
|
||
|
||
def convert_scsi_id_to_nguid(volume_id): | ||
logger.debug("Converting scsi uuid : {} to nguid".format(volume_id)) | ||
oui = volume_id[1:WWN_OUI_END] | ||
vendor_identifier = volume_id[WWN_OUI_END:WWN_VENDOR_IDENTIFIER_END] | ||
vendor_identifier_extension = volume_id[WWN_VENDOR_IDENTIFIER_END:] | ||
final_nguid = ''.join((vendor_identifier_extension, oui, '0', vendor_identifier)) | ||
logger.debug("Nguid is : {}".format(final_nguid)) | ||
return final_nguid | ||
|
||
|
||
def convert_nguid_to_scsi_id(volume_id): | ||
logger.debug("Converting nguid : {} to scsi uuid".format(volume_id)) | ||
oui = volume_id[WWN_VENDOR_IDENTIFIER_END:NGUID_OUI_END] | ||
vendor_identifier = volume_id[-VENDOR_IDENTIFIER_LENGTH:] | ||
vendor_identifier_extension = volume_id[:WWN_VENDOR_IDENTIFIER_END] | ||
final_scsi_id = ''.join((oui, vendor_identifier, vendor_identifier_extension)) | ||
logger.debug("scsi uuid is : {}".format(final_scsi_id)) | ||
return final_scsi_id | ||
|
||
|
||
class ClassProperty: | ||
|
||
def __init__(self, function): | ||
self._function = function | ||
|
||
def __get__(self, instance, owner): | ||
return self._function(owner) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import os.path | ||
|
||
import yaml | ||
from munch import DefaultMunch | ||
|
||
_this_file_path = os.path.abspath(os.path.dirname(__file__)) | ||
_config_path = os.path.join(_this_file_path, "../../common/config.yaml") | ||
|
||
with open(_config_path, 'r', encoding="utf-8") as yamlfile: | ||
_cfg = yaml.safe_load(yamlfile) | ||
config = DefaultMunch.fromDict(_cfg) | ||
import os.path | ||
|
||
import yaml | ||
from munch import DefaultMunch | ||
|
||
_this_file_path = os.path.abspath(os.path.dirname(__file__)) | ||
_config_path = os.path.join(_this_file_path, "../../common/config.yaml") | ||
|
||
with open(_config_path, 'r', encoding="utf-8") as yamlfile: | ||
_cfg = yaml.safe_load(yamlfile) | ||
config = DefaultMunch.fromDict(_cfg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import setuptools | ||
|
||
setuptools.setup(name='csi_general', packages=['csi_general']) | ||
import setuptools | ||
|
||
setuptools.setup(name='csi_general', packages=['csi_general']) |
Oops, something went wrong.