Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
time sync for nodes after reverting to snapshot
Browse files Browse the repository at this point in the history
Closes-Bug: #1256995

Change-Id: I71d31934c91a08f7e5cda34178d10c9632c3bd51
  • Loading branch information
Igor Shishkin committed Dec 3, 2013
1 parent 7afae28 commit 5dcd221
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions fuelweb_test/models/environment.py
Expand Up @@ -294,11 +294,20 @@ def nodes(self):
def revert_snapshot(self, name):
if self.get_virtual_environment().has_snapshot(name):
logging.info('We have snapshot with such name %s' % name)

self.get_virtual_environment().revert(name)
logging.info('Starting snapshot reverting ....')

self.get_virtual_environment().resume()
logging.info('Starting snapshot resuming ...')
time.sleep(10)

time.sleep(20)
list = self.fuel_web.client.list_cluster_nodes(
self.fuel_web.get_last_created_cluster() or 1
)
for node in list:
logging.info('Syncing time for node %s after reverting to snapshot' % node['name'])
self.sync_node_time(self.get_ssh_to_remote_by_name(node['name']))
return True
return False

Expand All @@ -318,9 +327,9 @@ def setup_environment(self):

@logwrap
def sync_node_time(self, remote):
remote.execute('hwclock --hctosys >/dev/null 2>&1 0<&1')
remote.execute('ntpd -g -u ntp:ntp >/dev/null 2>&1')
remote.execute('hwclock -w >/dev/null 2>&1')
remote.execute('hwclock --hctosys')
remote.execute('ntpdate -u %s' % self.get_admin_node_ip())
remote.execute('hwclock -w')

def sync_time_admin_node(self):
self.sync_node_time(self.get_admin_remote())
Expand Down

0 comments on commit 5dcd221

Please sign in to comment.