示例#1
0
#!/usr/bin/env python3
from chibi.command import yum, systemctl, command
from chibi.command.echo import cowsay
from chibi.file import Chibi_file
from chibi.file.snippets import inflate_dir

file_check_path = inflate_dir('~/provision_installed')
file_check = Chibi_file(file_check_path)

version_to_check = "redis\n".format(file=__file__, )

if __name__ == "__main__" and not version_to_check in file_check:
    cowsay("instalado redis")

    yum.install('redis')
    systemctl.start("redis")
    systemctl.enable("redis")

    cowsay("termino de instalar redis")

    result, error, return_code = command('redis-cli', 'ping', stdout='pipe')

    cowsay("redis ping say: {}".format(result))

    file_check.append(version_to_check)
示例#2
0
        'active_state', 'No'))
    try:
        response = requests.get(url)
    except:
        time.sleep(10)
        continue

    if (status == 'active' and str(response.status_code) == '200'):
        break
    time.sleep(10)
    print(status)
    print(response.status_code, response.text)

print(requests.get(url).text)

f = Chibi_file(join(FOLDER_PROVISION, "resource_event.template.json"))
j = f.read_json()
r = requests.put("{}/_template/turn_api__api_event".format(url),
                 json=j,
                 headers=headers)
print(r.text)

f = Chibi_file(join(FOLDER_PROVISION, "background_check.template.json"))
j = f.read_json()
r = requests.put("{}/_template/turn_api__background_checks".format(url),
                 json=j,
                 headers=headers)
print(r.text)

f = Chibi_file(join(FOLDER_PROVISION, "county.template.json"))
j = f.read_json()
示例#3
0
#!/usr/bin/env python3

import sys
from datetime import datetime

from chibi.file import Chibi_file, Chibi_path


path = Chibi_path( __file__ )

f = Chibi_file( ( path + "wpa_cli" ) + "wpa_cli" )
date = datetime.utcnow()

event = ",".join( sys.argv[1:] )

final_even = "{}\t{}\n".format( date.isoformat(), event )

f.append( final_even )