def show_message(message):
    """
    Prints message out on stdout message (kind of yes/no) and return answer.

    Return values are:
    Return True on accept (y/yes). Otherwise returns False
    """
    accept = ['y', 'yes']
    choice = MessageHelper.get_message(title=message, prompt='[Y/n]')
    if choice.lower() in accept:
        return True
    else:
        return False
Ejemplo n.º 2
0
def show_message(message):
    """
    Prints message out on stdout message (kind of yes/no) and return answer.

    Return values are:
    Return True on accept (y/yes). Otherwise returns False
    """
    accept = ['y', 'yes']
    choice = MessageHelper.get_message(title=message, prompt='[Y/n]')
    if choice.lower() in accept:
        return True
    else:
        return False
 def check_postmigrate_dir(self):
     if not FileHelper.get_list_executable_files_in_dir(os.path.join(settings.assessment_results_dir,
                                                                     settings.postmigrate_dir)):
         if not self.conf.assumeyes:
             accept = ['y', 'yes']
             log_message("The '%s' folder is empty - scripts to be executed "
                         "after the migration should be placed "
                         "here." % os.path.join(settings.result_dir,
                                                settings.postmigrate_dir))
             message = "Do you want to continue with kickstart " \
                       "generation without any postmigration scripts?"
             choice = MessageHelper.get_message(message=message, prompt="(Y/n)")
             if choice.lower() not in accept:
                 return None
     return True
Ejemplo n.º 4
0
 def check_postmigrate_dir(self):
     if not FileHelper.get_list_executable_files_in_dir(
             os.path.join(settings.assessment_results_dir,
                          settings.postmigrate_dir)):
         if not self.conf.assumeyes:
             accept = ['y', 'yes']
             log_message(
                 "The '%s' folder is empty - scripts to be executed "
                 "after the migration should be placed "
                 "here." % os.path.join(settings.result_dir,
                                        settings.postmigrate_dir))
             message = "Do you want to continue with kickstart " \
                       "generation without any postmigration scripts?"
             choice = MessageHelper.get_message(message=message,
                                                prompt="(Y/n)")
             if choice.lower() not in accept:
                 return None
     return True