Skip to content
Snippets Groups Projects
Select Git revision
  • th/rhel
  • am/openjdk
  • master default protected
  • th/promtail
4 results

ganeti-ups.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ganeti-ups.py 428 B
    #!/usr/bin/python2
    import sys
    KILLPOWER = "killpower"
    ONBATTERY = "onbattery"
    
    case = KILLPOWER
    if len(sys.argv) >= 2:
        case = sys.argv[1]
    
    if case not in {KILLPOWER, ONBATTERY}:
        case = KILLPOWER
    
    from ganeti import GanetiRapiClient
    rapi = GanetiRapiClient(host={{ ganeti_cluster_address }}, username={{ ganeti_rapi_user }}, password={{ ganeti_rapi_password }}) # todo: fix variable usage
    
    cluster_info = rapi.GetInfo()