This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| from Site import config, Login | |
| from Site.helpers import fetch_excel_values | |
| class Check_Excel_Logins(config.Fixtures_local): | |
| """ | |
| The test reads the excel , | |
| imports all the data in dictionaries | |
| logs in with every username(email)/password combination |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'wehappyfew' | |
| # the url of jenkins config.xml | |
| jenkins_url = 'http://11.11.111.11:8686/job/TheJob/config.xml' | |
| j_user = "someone" | |
| j_pass = "somepass" | |
| def get_jenkins_branch_name(jenkins_url, j_user, j_pass): | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def grid_nodes_num(grid_console_url="http://my_super_company.com:8080/grid/console#"): | |
| import requests | |
| from bs4 import BeautifulSoup | |
| r = requests.get(grid_console_url) | |
| html_doc = r.text | |
| soup = BeautifulSoup(html_doc) | |
| # print soup.prettify() # for debuggimg | |
| grid_nodes = soup.find_all("p", class_="proxyid") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def build_jenkins(j_url="http://11.11.11.11:8686/", job_name='SuperJob'): | |
| """ | |
| Build the current branch of a provided job | |
| """ | |
| import time | |
| from jenkins import Jenkins, JenkinsError | |
| # http://jenkins-webapi.readthedocs.org/en/latest/ | |
| j = Jenkins(j_url, j_user, j_pass) | |
| j.job_build(job_name) ; print("\nBuild command sent!\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'wehappyfew' | |
| # tutorial : http://cewing.github.io/training.codefellows/assignments/day12/fabric.htmlimport boto,boto.ec2 | |
| import boto,boto.ec2 | |
| from MyProjecte.AWS_credentials import aws_access_key_id,aws_secret_access_key | |
| from fabric.api import env, run, parallel | |
| # Make the connection to AWS account | |
| conn = boto.ec2.connect_to_region(region_name = "us-east-1", | |
| aws_access_key_id = aws_access_key_id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def build_jenkins(j_user, j_pass, j_url, job_name): | |
| """ | |
| # https://github.com/stackforge/python-jenkins | |
| # http://python-jenkins.readthedocs.org/en/latest/index.html | |
| """ | |
| import time | |
| from jenkins import Jenkins | |
| # set the jenkins object | |
| j = Jenkins(j_url, j_user, j_pass) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from my_AWS_credentials import aws_access_key_id,aws_secret_access_key | |
| import boto.route53 | |
| from boto.route53.record import ResourceRecordSets | |
| import boto.ec2 | |
| import itertools | |
| EC2conn = boto.ec2.connect_to_region(region_name = "us-east-1", | |
| aws_access_key_id = aws_access_key_id, | |
| aws_secret_access_key = aws_secret_access_key) | |
| def fetch_host_ips(EC2conn, tag, state): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def make_POST(live, arg1, arg2, variable_arg): | |
| """ | |
| """ | |
| import requests | |
| payload = { | |
| "arg1_key" : arg1, | |
| "arg2_key" : arg2 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'wehappyfew' | |
| import sys,os,pprint | |
| # check the sys.path before I add my directory | |
| print("1: -- ",sys.path) | |
| if os.name == "posix": # check if the script runs on Linux | |
| # If I comment it out, it will throw ImportError | |
| # This path should always be appended on runtime, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'wehappyfew' | |
| # http://boto.readthedocs.org/en/latest/ref/rds.html#boto.rds.RDSConnection.create_dbinstance_read_replica | |
| from AWS_project import us_east_1 | |
| import boto.rds, os, sys | |
| if os.name == "nt": #if I run it on WIN | |
| from AWS_project import aws_secret_access_key, aws_access_key_id | |
| RDSconn = boto.rds.connect_to_region(us_east_1, |