From 8c130b08ae645a01c08c3d3fa1d02fff0259916e Mon Sep 17 00:00:00 2001 From: "bhagyashree.sarawate" Date: Mon, 19 Aug 2019 19:12:11 +0530 Subject: [PATCH] fix for #718,#714,#711 --- hpedockerplugin/hpe/hpe_3par_common.py | 12 ++++++------ hpedockerplugin/hpe_storage_api.py | 4 ++-- hpedockerplugin/volume_manager.py | 7 ++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hpedockerplugin/hpe/hpe_3par_common.py b/hpedockerplugin/hpe/hpe_3par_common.py index 4d50d61b..faab093d 100644 --- a/hpedockerplugin/hpe/hpe_3par_common.py +++ b/hpedockerplugin/hpe/hpe_3par_common.py @@ -848,9 +848,9 @@ def create_volume(self, volume): extras['compression'] = compression else: err = (_("To create compression enabled volume, size of " - "the volume should be atleast 16GB. Fully " - "provisioned volume can not be compressed. " - "Please re enter requested volume size or " + "the volume should be at least 16GB. Fully " + "provisioned volume cannot be compressed. " + "Please re-enter requested volume size or " "provisioning type. ")) # LOG.error(err) raise exception.HPEDriverInvalidSizeForCompressedVolume( @@ -887,10 +887,10 @@ def create_volume(self, volume): msg = "For thin volume, 'provisioning' must be specified " \ "as 'thin'. And for deduplicated and compressed " \ "volume, 'provisioning' must be specified as 'dedup' " \ - "and 'compression' must be specified to true. " \ + "and 'compression' must be specified as true. " \ "If any of " \ - "these conditions for a given type of volume" \ - "is not met volume creation will fail" + "these conditions for a given type of volume " \ + "is not met volume creation will fail." raise exception.HPEDriverInvalidInput(reason=msg) raise exception.HPEDriverInvalidInput(reason=ex.get_description()) diff --git a/hpedockerplugin/hpe_storage_api.py b/hpedockerplugin/hpe_storage_api.py index 9c728a8f..3fb7d29d 100644 --- a/hpedockerplugin/hpe_storage_api.py +++ b/hpedockerplugin/hpe_storage_api.py @@ -709,7 +709,7 @@ def volumedriver_create_snapshot(self, name, mount_conflict_delay, if exphrs is not None: if rethrs > exphrs: msg = ('create schedule failed, error is: ' - 'expiration hours cannot be greater than ' + 'expiration hours must be greater than ' 'retention hours') LOG.error(msg) response = json.dumps({'Err': msg}) @@ -746,7 +746,7 @@ def volumedriver_create_snapshot(self, name, mount_conflict_delay, schedNameLength = len(schedName) snapPrefixLength = len(snapPrefix) if schedNameLength > 31 or snapPrefixLength > 15: - msg = ('Please provide a schedlueName with max 31 ' + msg = ('Please provide a scheduleName with max 31 ' 'characters and snapshotPrefix with max ' 'length of 15 characters') LOG.error(msg) diff --git a/hpedockerplugin/volume_manager.py b/hpedockerplugin/volume_manager.py index 32a5ca0f..d9a68b2c 100644 --- a/hpedockerplugin/volume_manager.py +++ b/hpedockerplugin/volume_manager.py @@ -119,9 +119,10 @@ def _initialize_configuration(self): "Failed to initialize driver - cpg_map not defined for" "replication device") - self.tgt_bkend_config.hpe3par_snapcpg = \ - self._extract_remote_cpgs( - self.tgt_bkend_config.snap_cpg_map) + if self.tgt_bkend_config.snap_cpg_map: + self.tgt_bkend_config.hpe3par_snapcpg = \ + self._extract_remote_cpgs( + self.tgt_bkend_config.snap_cpg_map) if not self.tgt_bkend_config.hpe3par_snapcpg: self.tgt_bkend_config.hpe3par_snapcpg = \ self.tgt_bkend_config.hpe3par_cpg