def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ["help"]) except getopt.GetoptError as e: usage(e) for opt, val in opts: if opt in ('-h', '--help'): usage() if args: usage() if not registry.sub_apikey and registry.fqdn: fatal("not initialized") try: hubdns = HubDNS(subkey=registry.sub_apikey) hubdns.release(registry.fqdn) except HubDNS.Error as e: fatal(e.description) print("Released DNS records associated with %s" % registry.fqdn)
sys.exit(1) def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ["help"]) except getopt.GetoptError, e: usage(e) for opt, val in opts: if opt in ('-h', '--help'): usage() if args: usage() if not registry.sub_apikey and registry.fqdn: fatal("not initialized") try: hubdns = HubDNS(subkey=registry.sub_apikey) hubdns.release(registry.fqdn) except HubDNS.Error, e: fatal(e.description) print "Released DNS records associated with %s" % registry.fqdn if __name__ == "__main__": main()
print >> sys.stderr, "Syntax: %s" % sys.argv[0] print >> sys.stderr, __doc__.strip() sys.exit(1) def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ["help"]) except getopt.GetoptError, e: usage(e) for opt, val in opts: if opt in ('-h', '--help'): usage() if args: usage() if not registry.sub_apikey and registry.fqdn: fatal("not initialized") try: hubdns = HubDNS(subkey=registry.sub_apikey) hubdns.release(registry.fqdn) except HubDNS.Error, e: fatal(e.description) print "Released DNS records associated with %s" % registry.fqdn if __name__=="__main__": main()