Skip to content

Commit

Permalink
Deleteing inaccessible nfs datastore before creating a new one
Browse files Browse the repository at this point in the history
Change-Id: I11e1aebff5912214ba7128185982e33b029d6e3a
  • Loading branch information
sandip-d committed Feb 16, 2017
1 parent 18f57b5 commit 89d0a2a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fixtures/vcenter.py
Expand Up @@ -59,6 +59,11 @@ def __init__(self, inputs, vc):
return #the vcenter server/reimaging the esxi hosts,we are only provisioning
#the contrail-controllers.Hence, the nfs datastore becomes
#in-accessiable.We need to create and mount the nfs datastore again.
else:
hosts = [host for cluster in vc._dc.hostFolder.childEntity for host in cluster.host]
for host in hosts:
self._delete_datastore(host,nas_ds)

username = inputs.host_data[self.server]['username']
password = inputs.host_data[self.server]['password']
with settings(host_string=username+'@'+self.server, password=password,
Expand All @@ -75,6 +80,10 @@ def __init__(self, inputs, vc):
for host in hosts:
host.configManager.datastoreSystem.CreateNasDatastore(spec)

def _delete_datastore(self,host,datastore):
host.configManager.datastoreSystem.RemoveDatastore(datastore)


class VcenterPvtVlanMgr:

__metaclass__ = Singleton
Expand Down

0 comments on commit 89d0a2a

Please sign in to comment.