def delete_repo(connection, repolist):
     '''
     delete a repository from the RHUI
     '''
     RHUIManager.screen(connection, "repo")
     Expect.enter(connection, "d")
     RHUIManager.select(connection, repolist)
     RHUIManager.proceed_without_check(connection)
     Expect.expect(connection, ".*rhui \(" + "repo" + "\) =>")
 def delete_repo(connection, repolist):
     '''
     delete a repository from the RHUI
     '''
     RHUIManager.screen(connection, "repo")
     Expect.enter(connection, "d")
     RHUIManager.select(connection, repolist)
     RHUIManager.proceed_without_check(connection)
     RHUIManager.quit(connection)
 def add_rh_repo_all(connection):
     '''
     add a new Red Hat content repository (All in Certificate)
     '''
     RHUIManager.screen(connection, "repo")
     Expect.enter(connection, "a")
     Expect.expect(connection, "Import Repositories:.*to abort:", 660)
     Expect.enter(connection, "1")
     RHUIManager.proceed_without_check(connection)
     RHUIManager.quit(connection, "", 180)
 def add_rh_repo_all(connection):
     '''
     add a new Red Hat content repository (All in Certificate)
     '''
     RHUIManager.screen(connection, "repo")
     Expect.enter(connection, "a")
     Expect.expect(connection, "Import Repositories:.*to abort:", 660)
     Expect.enter(connection, "1")
     RHUIManager.proceed_without_check(connection)
     Expect.expect(connection, ".*rhui \(" + "repo" + "\) =>", 180)
 def delete_all_repos(connection):
     '''
     delete all repositories from the RHUI
     '''
     RHUIManager.screen(connection, "repo")
     Expect.enter(connection, "d")
     Expect.expect(connection, "Enter value .*:", 360)
     Expect.enter(connection, "a")
     Expect.expect(connection, "Enter value .*:")
     Expect.enter(connection, "c")
     RHUIManager.proceed_without_check(connection)
     Expect.expect(connection, ".*rhui \(" + "repo" + "\) =>", 360)
 def generate_ent_cert(connection, repolist, certname, dirname, validity_days="", cert_pw=None):
     """
     generate an entitlement certificate
     """
     RHUIManager.screen(connection, "client")
     Expect.enter(connection, "e")
     RHUIManager.select(connection, repolist)
     Expect.expect(connection, "Name of the certificate.*contained with it:")
     Expect.enter(connection, certname)
     Expect.expect(connection, "Local directory in which to save the generated certificate.*:")
     Expect.enter(connection, dirname)
     Expect.expect(connection, "Number of days the certificate should be valid.*:")
     Expect.enter(connection, validity_days)
     RHUIManager.proceed_without_check(connection)
     Expect.expect(connection, ".*rhui \(" + "client" + "\) =>")
Example #7
0
 def delete_all_repos(connection):
     '''
     delete all repositories from the RHUI
     '''
     RHUIManager.screen(connection, "repo")
     Expect.enter(connection, "d")
     Expect.expect(connection, "Enter value .*:", 360)
     Expect.enter(connection, "a")
     Expect.expect(connection, "Enter value .*:")
     Expect.enter(connection, "c")
     RHUIManager.proceed_without_check(connection)
     # Wait until all repos are deleted
     RHUIManager.quit(connection, "", 360)
     while len(RHUIManagerRepo.list(connection)) != 0:
         time.sleep(10)
 def delete_all_repos(connection):
     '''
     delete all repositories from the RHUI
     '''
     RHUIManager.screen(connection, "repo")
     Expect.enter(connection, "d")
     status = Expect.expect_list(connection,
                                 [(re.compile(".*No repositories.*", re.DOTALL), 1),
                                  (re.compile(".*Enter value.*", re.DOTALL), 2)],
                                 360)
     if status == 1:
         RHUIManager.quit(connection)
         return
     Expect.enter(connection, "a")
     Expect.expect(connection, "Enter value .*:")
     Expect.enter(connection, "c")
     RHUIManager.proceed_without_check(connection)
     # Wait until all repos are deleted
     RHUIManager.quit(connection, "", 360)
     while RHUIManagerRepo.list(connection):
         time.sleep(10)
 def generate_ent_cert(connection,
                       repolist,
                       certname,
                       dirname,
                       validity_days=""):
     '''
     generate an entitlement certificate
     '''
     RHUIManager.screen(connection, "client")
     Expect.enter(connection, "e")
     RHUIManager.select(connection, repolist)
     Expect.expect(connection,
                   "Name of the certificate.*contained with it:")
     Expect.enter(connection, certname)
     Expect.expect(
         connection,
         "Local directory in which to save the generated certificate.*:")
     Expect.enter(connection, dirname)
     Expect.expect(connection,
                   "Number of days the certificate should be valid.*:")
     Expect.enter(connection, validity_days)
     RHUIManager.proceed_without_check(connection)
     RHUIManager.quit(connection)