__file__.split('\\')[-1].replace('.py', '') + ': ' + str(os.environ) +
        '\r\n')

resource = json.loads(os.environ['RESOURCECONTEXT'])
resource_name = resource['name']
attrs = resource['attributes']

vromAddress = attrs['Log Insight IP']
adminPassword = attrs['Log Insight Admin Password']

vropsHostname = attrs['vROPS FQDN']
vropsUsername = attrs['vROPS admin Username']
vropsPassword = attrs['vROPS admin Password']

#driver = webdriver.PhantomJS(executable_path=qualiroot() + '/phantomjs.exe', service_args=['--ignore-ssl-errors=true'])
driver = webdriver.Chrome(executable_path=qualiroot() + '/chromedriver.exe',
                          service_args=['--ignore-certificate-errors'])
driver.set_window_size(1440, 990)
driver.implicitly_wait(20)
wait = WebDriverWait(driver, 180)

#navigate to first page
driver.get("https://" + vromAddress + "/admin/vrops")

#login
#set username
driver.find_element_by_name('username').send_keys("admin")
#set password
driver.find_element_by_name('password').send_keys(adminPassword)
#click login
driver.find_element_by_id("login-button").click()
Пример #2
0
smtpServer = attrs['Log Insight SMTP Server']
smtpPort = attrs['Log Insight SMTP Port']

ss = attrs['Log Insight SMTP SSL']
smtpSSL = 1 if ss.lower() in ['yes', 'true'] else 0

tl = attrs['Log Insight SMTP STARTTLS']
smtpSTARTLS = 1 if tl.lower() in ['yes', 'true'] else 0

smtpSender = attrs['Log Insight SMTP Sender']
smtpUsername = attrs['Log Insight SMTP Username']
smtpPassword = attrs['Log Insight SMTP Password']


#driver = webdriver.PhantomJS(executable_path=qualiroot() + '/phantomjs.exe', service_args=['--ignore-ssl-errors=true'])
driver = webdriver.Chrome(executable_path=qualiroot() + '/chromedriver.exe', service_args=['--ignore-certificate-errors'])
driver.set_window_size(1440, 990)
driver.implicitly_wait(20)
wait = WebDriverWait(driver, 60)

#navigate to first page
driver.get("https://" + vLogAddress + "/admin/startup")

#wait for the next button
wait.until(EC.element_to_be_clickable((By.ID, 'skip-button')))
#click on next button
driver.find_element_by_id("skip-button").click()

#wait for the start new deployment button
wait.until(EC.element_to_be_clickable((By.ID, 'new-deployment-button')))
#click on start new deployment