bug fixes for backup (#60904)
This commit is contained in:
parent
63d4de7e1c
commit
a972ceb344
1 changed files with 12 additions and 42 deletions
|
@ -27,29 +27,6 @@ description:
|
||||||
|
|
||||||
options:
|
options:
|
||||||
|
|
||||||
src_hostname:
|
|
||||||
description:
|
|
||||||
- hostname for the backup source cluster
|
|
||||||
required: true
|
|
||||||
aliases:
|
|
||||||
- hostname
|
|
||||||
|
|
||||||
src_username:
|
|
||||||
description:
|
|
||||||
- username for the backup source cluster
|
|
||||||
required: true
|
|
||||||
aliases:
|
|
||||||
- username
|
|
||||||
- user
|
|
||||||
|
|
||||||
src_password:
|
|
||||||
description:
|
|
||||||
- password for the backup source cluster
|
|
||||||
required: true
|
|
||||||
aliases:
|
|
||||||
- password
|
|
||||||
- pass
|
|
||||||
|
|
||||||
src_volume_id:
|
src_volume_id:
|
||||||
description:
|
description:
|
||||||
- ID of the backup source volume.
|
- ID of the backup source volume.
|
||||||
|
@ -60,19 +37,19 @@ options:
|
||||||
dest_hostname:
|
dest_hostname:
|
||||||
description:
|
description:
|
||||||
- hostname for the backup source cluster
|
- hostname for the backup source cluster
|
||||||
- will be set equal to src_hostname if not specified
|
- will be set equal to hostname if not specified
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
dest_username:
|
dest_username:
|
||||||
description:
|
description:
|
||||||
- username for the backup destination cluster
|
- username for the backup destination cluster
|
||||||
- will be set equal to src_username if not specified
|
- will be set equal to username if not specified
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
dest_password:
|
dest_password:
|
||||||
description:
|
description:
|
||||||
- password for the backup destination cluster
|
- password for the backup destination cluster
|
||||||
- will be set equal to src_password if not specified
|
- will be set equal to password if not specified
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
dest_volume_id:
|
dest_volume_id:
|
||||||
|
@ -101,9 +78,9 @@ options:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
na_elementsw_backup:
|
na_elementsw_backup:
|
||||||
src_hostname: "{{ source_cluster_hostname }}"
|
hostname: "{{ source_cluster_hostname }}"
|
||||||
src_username: "{{ source_cluster_username }}"
|
username: "{{ source_cluster_username }}"
|
||||||
src_password: "{{ source_cluster_password }}"
|
password: "{{ source_cluster_password }}"
|
||||||
src_volume_id: 1
|
src_volume_id: 1
|
||||||
dest_hostname: "{{ destination_cluster_hostname }}"
|
dest_hostname: "{{ destination_cluster_hostname }}"
|
||||||
dest_username: "{{ destination_cluster_username }}"
|
dest_username: "{{ destination_cluster_username }}"
|
||||||
|
@ -125,7 +102,7 @@ import time
|
||||||
HAS_SF_SDK = netapp_utils.has_sf_sdk()
|
HAS_SF_SDK = netapp_utils.has_sf_sdk()
|
||||||
try:
|
try:
|
||||||
import solidfire.common
|
import solidfire.common
|
||||||
except Exception:
|
except ImportError:
|
||||||
HAS_SF_SDK = False
|
HAS_SF_SDK = False
|
||||||
|
|
||||||
|
|
||||||
|
@ -140,9 +117,6 @@ class ElementSWBackup(object):
|
||||||
|
|
||||||
self.argument_spec.update(dict(
|
self.argument_spec.update(dict(
|
||||||
|
|
||||||
src_hostname=dict(aliases=['hostname'], required=True, type='str'),
|
|
||||||
src_username=dict(aliases=['username', 'user'], required=True, type='str'),
|
|
||||||
src_password=dict(aliases=['password', 'pass'], required=True, type='str', no_log=True),
|
|
||||||
src_volume_id=dict(aliases=['volume_id'], required=True, type='str'),
|
src_volume_id=dict(aliases=['volume_id'], required=True, type='str'),
|
||||||
dest_hostname=dict(required=False, type='str'),
|
dest_hostname=dict(required=False, type='str'),
|
||||||
dest_username=dict(required=False, type='str'),
|
dest_username=dict(required=False, type='str'),
|
||||||
|
@ -165,26 +139,22 @@ class ElementSWBackup(object):
|
||||||
|
|
||||||
# If destination cluster details are not specified , set the destination to be the same as the source
|
# If destination cluster details are not specified , set the destination to be the same as the source
|
||||||
if self.module.params["dest_hostname"] is None:
|
if self.module.params["dest_hostname"] is None:
|
||||||
self.module.params["dest_hostname"] = self.module.params["src_hostname"]
|
self.module.params["dest_hostname"] = self.module.params["hostname"]
|
||||||
if self.module.params["dest_username"] is None:
|
if self.module.params["dest_username"] is None:
|
||||||
self.module.params["dest_username"] = self.module.params["src_username"]
|
self.module.params["dest_username"] = self.module.params["username"]
|
||||||
if self.module.params["dest_password"] is None:
|
if self.module.params["dest_password"] is None:
|
||||||
self.module.params["dest_password"] = self.module.params["src_password"]
|
self.module.params["dest_password"] = self.module.params["password"]
|
||||||
|
|
||||||
params = self.module.params
|
params = self.module.params
|
||||||
|
|
||||||
# establish a connection to both source and destination sf clusters
|
# establish a connection to both source and destination elementsw clusters
|
||||||
|
|
||||||
self.module.params["username"] = params["src_username"]
|
|
||||||
self.module.params["password"] = params["src_password"]
|
|
||||||
self.module.params["hostname"] = params["src_hostname"]
|
|
||||||
self.src_connection = netapp_utils.create_sf_connection(self.module)
|
self.src_connection = netapp_utils.create_sf_connection(self.module)
|
||||||
self.module.params["username"] = params["dest_username"]
|
self.module.params["username"] = params["dest_username"]
|
||||||
self.module.params["password"] = params["dest_password"]
|
self.module.params["password"] = params["dest_password"]
|
||||||
self.module.params["hostname"] = params["dest_hostname"]
|
self.module.params["hostname"] = params["dest_hostname"]
|
||||||
self.dest_connection = netapp_utils.create_sf_connection(self.module)
|
self.dest_connection = netapp_utils.create_sf_connection(self.module)
|
||||||
|
|
||||||
self.elementsw_helper = NaElementSWModule(self.sfe)
|
self.elementsw_helper = NaElementSWModule(self.src_connection)
|
||||||
|
|
||||||
# add telemetry attributes
|
# add telemetry attributes
|
||||||
self.attributes = self.elementsw_helper.set_element_attributes(source='na_elementsw_backup')
|
self.attributes = self.elementsw_helper.set_element_attributes(source='na_elementsw_backup')
|
||||||
|
|
Loading…
Reference in a new issue