def repo_info(connection, repo_id, repo_name): ''' check if information about the given repo can be displayed ''' Expect.ping_pong(connection, "rhui-manager repo info --repo_id " + repo_id, "Name: *" + Util.esc_parentheses(repo_name))
def select(connection, value_list): ''' Select list of items (multiple choice) ''' for value in value_list: match = Expect.match( connection, re.compile( ".*-\s+([0-9]+)\s*:[^\n]*\s+" + Util.esc_parentheses(value) + "\s*\n.*for more commands:.*", re.DOTALL)) Expect.enter(connection, match[0]) match = Expect.match( connection, re.compile( ".*x\s+([0-9]+)\s*:[^\n]*\s+" + Util.esc_parentheses(value) + "\s*\n.*for more commands:.*", re.DOTALL)) Expect.enter(connection, "l") Expect.enter(connection, "c")
def get_repo_status(connection, repo_name): ''' (internally used) method to get the status of the given repository ''' Expect.enter(connection, "rhui-manager status") status = Expect.match( connection, re.compile( ".*" + Util.esc_parentheses(repo_name) + "[^A-Z]*([A-Za-z]*).*", re.DOTALL))[0] return status
def get_repo_status(connection, reponame): ''' display repo sync summary ''' RHUIManager.screen(connection, "sync") Expect.enter(connection, "dr") reponame_quoted = Util.esc_parentheses(reponame) res = Expect.match( connection, re.compile(".*" + reponame_quoted + "\s*\r\n([^\n]*)\r\n.*", re.DOTALL), [1], 60)[0] connection.cli.exec_command("killall -s SIGINT rhui-manager") res = Util.uncolorify(res) ret_list = res.split(" ") for i in range(len(ret_list)): ret_list[i] = ret_list[i].strip() Expect.enter(connection, '\x03') Expect.enter(connection, 'q') return ret_list
def repo_list(connection, repo_id, repo_name): ''' check if the given repo ID and name are listed ''' Expect.ping_pong(connection, "rhui-manager repo list", repo_id + " *:: " + Util.esc_parentheses(repo_name))
def repo_unused(connection, repo): ''' check if a repo specified by its product name is available ''' Expect.ping_pong(connection, "rhui-manager repo unused", Util.esc_parentheses(repo))