Module Expr Str Import alias Import alias Import alias Import alias Import alias ImportFrom alias Import alias Import alias Assign NameStore Dict Str Str Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Str FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad If NameLoad body Return TupleLoad Str Str While BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpMod NameLoad Str attr Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpMod NameLoad Str attr Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str NameLoad attr If CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Return NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str NameLoad If NameLoad body Return SubscriptLoad NameLoad Index Str orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str BinOpMod Str NameLoad If CompareGt Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Return NameLoad If NameLoad body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Num Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad Return CompareEq NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Str Assign NameStore Call NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If CompareGt Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword NameLoad Assign TupleStore NameStore NameStore Call NameLoad If AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr If BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse If AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse While Num body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num Expr Call NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A 
Aerostat - Do lookups and configure hostname (locally) inside EC2.

This is the client code which Registers new hosts into the aerostat naming
service when run in --register mode. Otherwise, it's assumed that the host
is seeking an update to its name resolution (/etc/hosts).
 N/A logging N/A os N/A pymongo N/A time N/A urllib2 optparse OptionParser N/A registrar N/A updater N/A LEVELS N/A debug info warning error critical N/A logging DEBUG N/A logging INFO N/A logging WARNING N/A logging ERROR N/A logging CRITICAL N/A INFO_URL http://169.254.169.254/latest/meta-data/%s get_mongo_info N/A N/A N/A N/A N/A Get mongodb connection information (if any) from ENV. N/A server N/A N/A N/A os environ get AEROSTAT_SERVER admin-master N/A port N/A N/A N/A os environ get AEROSTAT_PORT 27017 N/A N/A server port N/A db_connect N/A N/A host port N/A N/A N/A Connect to MongoDB.

    Args:
        host: str, hostname of mongodb server.
        port: int, port number for mongodb; defaults to 27017.
    Returns:
        returns pymongo.Connection instance.
     N/A N/A N/A logging debug N/A Connecting to mongo on host %s and port %s. N/A host port N/A N/A N/A pymongo Connection host port N/A db_disconnect N/A N/A conn N/A N/A N/A Disconnect Mongodb Connection. N/A N/A N/A logging debug Disconnecting from mongodb. N/A N/A N/A conn disconnect N/A get_aws_data N/A N/A offline N/A False N/A N/A Retrieve information from metadata server in EC2. N/A instance_id None N/A local_ip None N/A offline N/A N/A N/A test-instance test_local_ip N/A N/A N/A instance_id None N/A local_ip None N/A N/A instance_id N/A N/A N/A N/A urllib2 urlopen N/A INFO_URL instance-id read N/A N/A N/A logging debug N/A Recieved instance id from AWS: %s. instance_id N/A local_ip N/A N/A N/A N/A urllib2 urlopen N/A INFO_URL local-ipv4 read N/A N/A N/A logging debug N/A Recieved local_ip from AWS: %s. local_ip N/A N/A instance_id local_ip N/A hostname_exists N/A N/A db hostname N/A N/A N/A Check if a hostname exists. N/A results N/A N/A N/A N/A N/A db servers find N/A hostname hostname count N/A N/A results 0 N/A N/A N/A N/A logging info N/A Hostname %s exists hostname N/A True N/A N/A N/A N/A logging info N/A Hostname %s doesn't exist hostname N/A False N/A get_hostname N/A N/A db inst_id N/A N/A N/A Get the hostname for an instnace. N/A result N/A N/A N/A db servers find_one N/A instance_id inst_id N/A result N/A N/A N/A result N/A hostname N/A N/A None N/A get_master N/A N/A db service N/A N/A N/A Get the master instance_id for a service.

    Args:
        db: mongodb db reference.
        service: str, service name of master whose instance id we need.
    Returns:
        str, master instance_id for service.
     N/A master_id None N/A res N/A list N/A N/A N/A db servers find N/A hostname N/A %s-master service N/A N/A N/A len res 1 N/A N/A N/A N/A logging error N/A Multiple masters listed for %s service. Aborting service N/A None N/A res N/A N/A master_id N/A N/A res N/A 0 N/A instance_id N/A master_id N/A check_master N/A N/A db service inst_id N/A N/A N/A Check to see if current host is master.

    Args:
        db: mongodb db reference.
        service: str, name of service to check mastership for
        current host.
        inst_id: str, the instance id for the current host.
    Returns:
        bool, True if master.
     N/A cur_master N/A get_master db service N/A N/A cur_master inst_id N/A main N/A N/A N/A N/A N/A usage usage: %prog [options] arg1 arg2 N/A parser N/A OptionParser usage usage N/A N/A N/A parser add_option --register action store_true dest register help Register server as a new Aerostat Client. N/A N/A N/A parser add_option --change-master action store_true dest change_master help Make current host the master for its service. N/A N/A N/A parser add_option --update action store_true dest update help Update /etc/hosts. N/A N/A N/A parser add_option --server action store dest server help hostname of aerostat/mongo server to connect to. N/A N/A N/A parser add_option --daemon action store_true dest daemon help Whether or not to run service (update) as a daemon. N/A N/A N/A parser add_option --loglevel action store dest loglevel help Which severity of log to display. N/A N/A N/A parser add_option --legacy-updater action store dest legacy help Specify path. Run legacy naming service prior to aerostat. N/A N/A N/A parser add_option --dryrun action store_true dest dry_run default False help Whether or not to actually carry our registration and updates. N/A N/A N/A parser add_option --offline action store_true dest offline default False help Whether or not we should connect to AWS for information. N/A N/A N/A parser add_option --update-configs action store_true dest update_configs default False help Update configuration files? N/A N/A N/A parser add_option --configs action store dest configs default None help specific configs to update (space sep in quotes) N/A N/A options args N/A N/A parser parse_args N/A N/A N/A len args 1 N/A N/A N/A N/A parser error Please supply some arguments N/A level N/A N/A LEVELS get N/A options loglevel N/A logging NOTSET N/A N/A N/A logging basicConfig level level N/A N/A mserver mport N/A get_mongo_info N/A N/A options server N/A N/A mserver N/A options server N/A conn N/A db_connect mserver mport N/A db N/A conn aerostat N/A N/A N/A options register N/A options change_master N/A N/A reg N/A N/A registrar Registrar N/A N/A N/A reg do_registrar db N/A options dry_run N/A options change_master N/A options offline N/A N/A N/A options update_configs N/A N/A conf_db N/A conn configs N/A config N/A N/A configurer Configurer N/A N/A N/A config do_update conf_db config_names N/A N/A N/A options configs split N/A N/A update N/A N/A updater Updater N/A N/A N/A options daemon N/A N/A N/A N/A update do_update db N/A options dry_run N/A options legacy N/A N/A 1 N/A N/A N/A N/A N/A N/A update do_update db N/A options dry_run N/A options legacy N/A N/A N/A N/A N/A pymongo errors AutoReconnect N/A N/A N/A N/A logging error N/A Unable to connect to database %s:%s. Sleeping. N/A mserver N/A str mport N/A N/A N/A time sleep 60 N/A N/A db_disconnect conn N/A N/A N/A __name__ __main__ N/A N/A N/A main