Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #45 from BlackSmith/master
Browse files Browse the repository at this point in the history
Fix timeout for booting system
  • Loading branch information
BlackSmith authored Jun 14, 2018
2 parents 7389f89 + bd77e97 commit e40a8b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions 5minute.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Name: 5minute
Version: 0.2.29
Name: 5minute
Version: 0.2.30

Release: 1%{?dist}
Summary: Command line tool for getting instance from OpenStack

Expand Down
12 changes: 7 additions & 5 deletions vminute/vminute.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,8 @@ def boot_instance(self):
self.__setup_networking()
dep_IPs[dep_name] = self.variables.get('floating-ip')['floating_ip_address']
self.__setup_volume(image)
self.__setup_userdata_script(image)
self.__choose_flavor(image)
self.__setup_userdata_script(image)
self.__create_instance(image)
except Exception as ex:
self.__release_resources()
Expand Down Expand Up @@ -1121,8 +1121,9 @@ def __setup_userdata_script(self, image):
cscript = re.sub(r'^#!/bin/bash', '', cscript, flags=re.M)
self.params['cscript'] += cscript.format(**self.variables)
self.params['cscript'] += "\n"
self.params['cscript'] += 'echo "\n%s" > /dev/ttyS0;' % \
self.cinit_ending_text
self.params['cscript'] += 'echo "\n%s" > /dev/ttyS0;' %\
self.cinit_ending_text
self.params['cscript'] += 'wall "%s"' % self.cinit_ending_text
progress(result="DONE")

def __setup_volume(self, image):
Expand Down Expand Up @@ -1211,7 +1212,8 @@ def __check_console_output(self, server):
lindex = 0
show_output = self.params.get('console')
exit_status = None
counter = 60
exit_message = "DONE"
counter = 300
isatty = sys.stderr.isatty()
reg_exit = re.compile(r".*login:\s*$")
if 'cscript' in self.params and len(self.params['cscript']) > 0:
Expand All @@ -1235,7 +1237,7 @@ def __check_console_output(self, server):
if not show_output:
progress()
else:
counter = 60
counter = 300
# we can work only with new lines
output = output[-1 * (length - length_old):]
length_old = length
Expand Down

0 comments on commit e40a8b4

Please sign in to comment.