#!/usr/bin/env python
import sys, os, boto, psutil, re, getpass
from euca_admin import local
from optparse import OptionParser

def main():
  parser = OptionParser("usage: %prog FILENAME",version="Eucalyptus %prog VERSION",description="Download the admin credentials for the locally hosted Eucalyptus installation")
  parser.add_option("-s","--source",dest="source",default=False,action="store_true",help="Unzip (and remove zipfile) and output 'eucarc'.  If FILENAME is specified the archive will be extracted to `dirname FILENAME`.  Otherwise, the archive is extracted to the current working directory.")
  (options,args) = parser.parse_args()
  file = None
  if len(args) != 1 and not options.source:
    parser.print_help()
    sys.exit()
  elif len(args) != 0:
    file = args[0]
  local.get_credentials(file,options.source)
  sys.exit()

if __name__ == "__main__":
    main()
 
