Skip to content

Instantly share code, notes, and snippets.

@WaltHP
Created March 9, 2016 23:27
Show Gist options
  • Select an option

  • Save WaltHP/d8c8071bb9006b217fb1 to your computer and use it in GitHub Desktop.

Select an option

Save WaltHP/d8c8071bb9006b217fb1 to your computer and use it in GitHub Desktop.
diff --git a/hpe3parclient/client.py b/hpe3parclient/client.py
index 7272f70..9ad988f 100644
--- a/hpe3parclient/client.py
+++ b/hpe3parclient/client.py
@@ -711,7 +711,7 @@ class HPE3ParClient(object):
response, body = self.http.put('/volumes/%s' % name, body=info)
return body
- def copyVolume(self, src_name, dest_name, dest_cpg, optional=None):
+ def copyVolume(self, src_name, dest_name, dest_cpg=None, optional=None):
"""Copy/Clone a volume.
:param src_name: the source volume name
@@ -829,6 +829,10 @@ class HPE3ParClient(object):
if optional:
parameters = self._mergeDict(parameters, optional)
+ if 'online' not in paramaters or parameters['online'] == False:
+ # 3Par won't allot destCPG to be set if it's not an online copy.
+ parameters.pop('destCPG', None)
+
info = {'action': 'createPhysicalCopy',
'parameters': parameters}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment