(self)
return (webserver, pkgbase)
Gets user input for configuration parameters.
Gets user input for configuration parameters.
Gets user input for configuration parameters .
def ConfigQuestionnaire(self):
    """Gets user input for configuration parameters."""
    for item in self.config_info:
      self.configured_settings.append(item)
    if 'webserver' in self.configured_settings:
      webserver = self.config_info['webserver']
    else:
      webserver = 'example: http://www.yourserver.com'
    question = ('Please provide the URL for the server you store your'
                ' images and packages on.\nCurrent setting: %s' % webserver)
    prompt = 'Server URL: '
    unanswered = True
    while unanswered:
      try:
        userinput = self.GetUserInput(question, prompt)
      except KeyboardInterrupt:
        print 'Ctrl+C pressed; aborting configuration setup.'
        sys.exit()
      # pylint: disable-msg=C6403
      if userinput != '' and not userinput.startswith('example:'):
      # pylint: enable-msg=C6403
        webserver = userinput
        unanswered = False
      elif userinput == '' or userinput.startswith('example:'):
        question = 'You did not provide a URL - please try again.'

    if 'pkgbase' in self.configured_settings:
      pkgbase = self.config_info['pkgbase']
    else:
      pkgbase = 'example: http://www.yourserver.com/packages'
    question = ('Please provide the URL for the server containing the'
                ' packages you wish to install in your images.\n'
                'Current setting: %s' % pkgbase)
    prompt = 'Server URL: '
    unanswered = True
    while unanswered:
      try:
        userinput = self.GetUserInput(question, prompt)
      except KeyboardInterrupt:
        print 'Ctrl+C pressed; aborting configuration setup.'
        sys.exit()
      # pylint: disable-msg=C6403
      if userinput != '' and not userinput.startswith('example:'):
      # pylint: enable-msg=C6403
        pkgbase = userinput
        unanswered = False
      elif userinput != '' and userinput.startswith('example:'):
        question = 'You did not provide a URL - please try again.'

    return (webserver, pkgbase)
def ConfigQuestionnaire ( self ) : for item in self . config_info : self . configured_settings . append ( item ) if 'webserver' in self . configured_settings : webserver = self . config_info [ 'webserver' ] else : webserver = 'example: http://www.yourserver.com' question = ( 'Please provide the URL for the server you store your' ' images and packages on.\nCurrent setting: %s' % webserver ) prompt = 'Server URL: ' unanswered = True while unanswered : try : userinput = self . GetUserInput ( question , prompt ) except KeyboardInterrupt : print 'Ctrl+C pressed; aborting configuration setup.' sys . exit ( ) # pylint: disable-msg=C6403 if userinput != '' and not userinput . startswith ( 'example:' ) : # pylint: enable-msg=C6403 webserver = userinput unanswered = False elif userinput == '' or userinput . startswith ( 'example:' ) : question = 'You did not provide a URL - please try again.' if 'pkgbase' in self . configured_settings : pkgbase = self . config_info [ 'pkgbase' ] else : pkgbase = 'example: http://www.yourserver.com/packages' question = ( 'Please provide the URL for the server containing the' ' packages you wish to install in your images.\n' 'Current setting: %s' % pkgbase ) prompt = 'Server URL: ' unanswered = True while unanswered : try : userinput = self . GetUserInput ( question , prompt ) except KeyboardInterrupt : print 'Ctrl+C pressed; aborting configuration setup.' sys . exit ( ) # pylint: disable-msg=C6403 if userinput != '' and not userinput . startswith ( 'example:' ) : # pylint: enable-msg=C6403 pkgbase = userinput unanswered = False elif userinput != '' and userinput . startswith ( 'example:' ) : question = 'You did not provide a URL - please try again.' return ( webserver , pkgbase )