Exemplo n.º 1
0
def main():
    """
    Add a user to openstack.
    """
    errors = []
    parser = argparse.ArgumentParser()
    parser.add_argument("--provider-id",
                        type=int,
                        required=True,
                        help="Atmosphere provider ID"
                        " to use when importing users.")
    parser.add_argument("--users",
                        help="LDAP usernames to import. (comma separated)")
    parser.add_argument(
        "--end",
        help=
        "End date to use for monitoring. Expects Log formatting: YYYY-MM-DD HH:MM:SS"
    )
    args = parser.parse_args()
    openstack_prov = Provider.objects.get(id=args.provider_id)
    users = args.users.split(',') if args.users else None
    if not args.end:
        end_date = None
    try:
        end_date = _local_date_str_to_utc_date(args.end)
    except ValueError as bad_format:
        print >> sys.stderr, "ERROR: End date '%s'"\
            " does not match Expected format: 'YYYY-MM-DD HH:MM:SS'"
        return 1
    monitor_instances_for(openstack_prov.id,
                          users=users,
                          print_logs=True,
                          end_date=end_date)
def main():
    """
    Add a user to openstack.
    """
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--provider-id",
        type=int,
        required=True,
        help="Atmosphere provider ID"
        " to use when importing users."
    )
    parser.add_argument(
        "--users", help="LDAP usernames to import. (comma separated)"
    )
    parser.add_argument(
        "--end",
        help=
        "End date to use for monitoring. Expects Log formatting: YYYY-MM-DD HH:MM:SS"
    )
    args = parser.parse_args()
    openstack_prov = Provider.objects.get(id=args.provider_id)
    users = args.users.split(',') if args.users else None
    if not args.end:
        end_date = None
    try:
        end_date = _local_date_str_to_utc_date(args.end)
    except ValueError:
        print >> sys.stderr, "ERROR: End date '%s'"\
            " does not match Expected format: 'YYYY-MM-DD HH:MM:SS'"
        return 1
    monitor_instances_for(
        openstack_prov.id, users=users, print_logs=True, end_date=end_date
    )
Exemplo n.º 3
0
def main():
    """
    Add a user to openstack.
    """
    errors = []
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--provider-id", type=int, required=True, help="Atmosphere provider ID" " to use when importing users."
    )
    parser.add_argument("--users", help="LDAP usernames to import. (comma separated)")
    args = parser.parse_args()
    openstack_prov = Provider.objects.get(id=args.provider_id)
    users = args.users.split(",") if args.users else None
    monitor_instances_for(openstack_prov, users=users, print_logs=True)
Exemplo n.º 4
0
def main():
    """
    Add a user to openstack.
    """
    errors = []
    parser = argparse.ArgumentParser()
    parser.add_argument("--provider-id", type=int, required=True,
                        help="Atmosphere provider ID"
                        " to use when importing users.")
    parser.add_argument("--users",
                        help="LDAP usernames to import. (comma separated)")
    args = parser.parse_args()
    openstack_prov = Provider.objects.get(id=args.provider_id)
    users = args.users.split(',') if args.users else None
    monitor_instances_for(openstack_prov, users=users, print_logs=True)
Exemplo n.º 5
0
def main():
    """
    Add a user to openstack.
    """
    errors = []
    parser = argparse.ArgumentParser()
    parser.add_argument("--provider-id", type=int, required=True,
                        help="Atmosphere provider ID"
                        " to use when importing users.")
    parser.add_argument("--users",
                        help="LDAP usernames to import. (comma separated)")
    parser.add_argument("--end",
            help="End date to use for monitoring. Expects Log formatting: YYYY-MM-DD HH:MM:SS")
    args = parser.parse_args()
    openstack_prov = Provider.objects.get(id=args.provider_id)
    users = args.users.split(',') if args.users else None
    if not args.end:
        end_date = None
    try:
        end_date = _local_date_str_to_utc_date(args.end)
    except ValueError, bad_format:
        print >> sys.stderr, "ERROR: End date '%s'"\
                " does not match Expected format: 'YYYY-MM-DD HH:MM:SS'"
        return 1
    monitor_instances_for(openstack_prov.id, users=users,
                          print_logs=True, end_date=end_date)

if __name__ == "__main__":
    main()

Exemplo n.º 6
0
def main():
    """
    Add a user to openstack.
    """
    errors = []
    parser = argparse.ArgumentParser()
    parser.add_argument("--provider-id", type=int, required=True,
                        help="Atmosphere provider ID"
                        " to use when importing users.")
    parser.add_argument("--users",
                        help="LDAP usernames to import. (comma separated)")
    parser.add_argument("--end",
            help="End date to use for monitoring. Expects Log formatting: YYYY-MM-DD HH:MM:SS")
    args = parser.parse_args()
    openstack_prov = Provider.objects.get(id=args.provider_id)
    users = args.users.split(',') if args.users else None
    if not args.end:
        end_date = None
    try:
        end_date = _local_date_str_to_utc_date(args.end)
    except ValueError, bad_format:
        print >> sys.stderr, "ERROR: End date '%s'"\
                " does not match Expected format: 'YYYY-MM-DD HH:MM:SS'"
        return 1
    monitor_instances_for(openstack_prov.id, users=users,
                          print_logs=True, end_date=end_date)

if __name__ == "__main__":
    main()