#!/usr/bin/env python
# Usage: devops server-catalog
# Summary: View list of nova and chef servers
# optional arguments:
#   -h, --help  show this help message and exit

import sys
import os
import subprocess
import argparse

pylib_dir = os.environ['_DEVOPS_ROOT'] + "/share/devops/"
sys.path.insert(0, pylib_dir)
import devop_config

CONFIG = devop_config.config()


def server_catalog():
    cmds = ('nova list --fields=name',
            'knife node list')

    for c in cmds:
        devop_config.ssh_cmd('{cmd}'.format(cmd=c), host='local')

def test(role=None):
    devop_config.ssh_cmd('curl http://localhost:80', role=role)

def main():
    parser = argparse.ArgumentParser()
    args = parser.parse_args()

    server_catalog()

if __name__ == "__main__":
	main()
