Ejemplo n.º 1
0
    dayTime = generic.dateTimeFields()
    dayTime += '_' + 'wowgic'
    return dayTime


############################################################################

globalS.init()  #intialize the global variables
generic = generic.generic()

#==============================================================================#
#           Opening log file to record all the cli outputs                     #
#==============================================================================#
sufFileName = compileFileName()
logFileName = "/tmp/" + sufFileName + ".log"
logger = loggerRecord.loggerInit(logFileName, args.logLevel)
logger.debug('Log file# %s & TestBed file ', logFileName)

#keys from twitter is stored here temp will be removed once we access the user credentials
#chella's credentials
consumer_key = 'HwvpHtsPt3LmOZocZXwtn72Zv'
consumer_secret = 'afVEAR0Ri3ZluVItqbDi0kfm7BHSxjwRXbpw9m9kFhXGjnzHKh'
access_token = '419412786-cpS2hDmR6cuIf8BD2kSSri0BAWAmXBA3pzcB56Pw'
access_secret = 'pRx5MNKkmxyImwuhUFMNVOr1NrAWcRmOGUgGTLVYFAjsJ'

#authenticate twitter app
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_secret)
api = tweepy.API(auth)

neo4jInt = neo4jInterface.neo4jInterface()
Ejemplo n.º 2
0
from celery import Celery
import sys
sys.path.append('../common')
sys.path.append('../config')
sys.path.append('../resources')
import globalS
import generic
import loggerRecord
import json

logFileName = '/tmp/wowgic_celery.log'
logger, fhandler = loggerRecord.loggerInit(logFileName, 'debug')
logger.debug('Log file# %s & TestBed file', logFileName)
celery = Celery('tasks', broker='amqp://guest@localhost//')
# Load the default configuration
celery.config_from_object('celeryconfig')
#read config from envt variable
#celery.config_from_envvar('CELERY_CONFIG_FILE')#D:\wowgic-env\wowgic\wowgic_flask\instance\flaskapp.cfg
#filename = os.path.join(app.instance_path, 'application.cfg')
#with open(filename) as f:
#    config = f.read()
globalS.dictDb = celery.conf
logger.debug('celery dictDB contains %s', globalS.dictDb)

import intercom
intercom = intercom.intercom()
'''
Rough Tasks:
First read all the interest nodes from neo4j
create a common module that inokes instagram & twitter
using celery delay method pass argumenmts to that and invoke the tasks
Ejemplo n.º 3
0
############################################################################
#Function Name  : compileFileName                                          #
#Input          : Nil                                                      #
#Return Value   : just sets the suffix fileName for logs                   #
############################################################################
def compileFileName():
    dayTime = generic.dateTimeFields()
    dayTime += '_' + testCaseName
    return dayTime


############################################################################

sufFileName = compileFileName()
logFileName = "/tmp/loggyTool" + "_" + sufFileName + ".log"
logger = loggerRecord.loggerInit(logFileName)
logger.debug('Log file# %s & TestBed file is %s', logFileName, scrDefFile)
#currently this is not working debug later
if args.debug:
    logger.setLevel('DEBUG')

#create an Object for ocpmSsh
ssh = ocpmSsh.ocpmSsh()
cmpObj = ssh.sshServer(OCPMTestbench['CMP_IP'], OCPMTestbench['CMP_UserName'],
                       OCPMTestbench['CMP_Pswd'])
ipList = ssh.addrProdCorr(cmpObj)

#remove the first IP as it belongs to CMP from where we no longer required any log as of now
ipList.remove(ipList[0])
logger.debug("IP's retrived are %s", ipList)
Ejemplo n.º 4
0
    dayTime = "wowgic" + "_" + "flask"
    return dayTime


############################################################################

globalS.init()  # intialize the global variables
globalS.dictDb = app.config
generic = generic.generic()

# ==============================================================================#
#           Opening log file to record all the cli outputs                     #
# ==============================================================================#
sufFileName = compileFileName()
logFileName = "/tmp/" + sufFileName + ".log"
logger, fhandler = loggerRecord.loggerInit(logFileName, args.logLevel)
logger.debug("Log file# %s & TestBed file", logFileName)
logger.debug("global dictDB file# %s", globalS.dictDb)
# logger.debug('global app file# %s',app.config)
logger.info(
    """
.----------------.  .----------------.  .----------------.  .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| | _____  _____ | || |     ____     | || | _____  _____ | || |    ______    | || |     _____    | || |     ______   | |
| ||_   _||_   _|| || |   .'    `.   | || ||_   _||_   _|| || |  .' ___  |   | || |    |_   _|   | || |   .' ___  |  | |
| |  | | /\ | |  | || |  /  .--.  \  | || |  | | /\ | |  | || | / .'   \_|   | || |      | |     | || |  / .'   \_|  | |
| |  | |/  \| |  | || |  | |    | |  | || |  | |/  \| |  | || | | |    ____  | || |      | |     | || |  | |         | |
| |  |   /\   |  | || |  \  `--'  /  | || |  |   /\   |  | || | \ `.___]  _| | || |     _| |_    | || |  \ `.___.'\  | |
| |  |__/  \__|  | || |   `.____.'   | || |  |__/  \__|  | || |  `._____.'   | || |    |_____|   | || |   `._____.'  | |
| |              | || |              | || |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
Ejemplo n.º 5
0
from celery import Celery
import sys
sys.path.append('../common')
sys.path.append('../config')
sys.path.append('../resources')
import globalS
import generic
import loggerRecord
import json

logFileName='/tmp/wowgic_celery.log'
logger,fhandler       = loggerRecord.loggerInit(logFileName,'debug')
logger.debug('Log file# %s & TestBed file',logFileName)
celery = Celery('tasks', broker='amqp://guest@localhost//')
# Load the default configuration
celery.config_from_object('celeryconfig')
#read config from envt variable
#celery.config_from_envvar('CELERY_CONFIG_FILE')#D:\wowgic-env\wowgic\wowgic_flask\instance\flaskapp.cfg
#filename = os.path.join(app.instance_path, 'application.cfg')
#with open(filename) as f:
#    config = f.read()
globalS.dictDb = celery.conf
logger.debug('celery dictDB contains %s',globalS.dictDb)

import intercom
intercom=intercom.intercom()

'''
Rough Tasks:
First read all the interest nodes from neo4j
create a common module that inokes instagram & twitter