Support subdomains [patch]

Bug #940656 reported by Mark Rose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cirrus
Fix Released
Undecided
Tim Kuhlman

Bug Description

I use subdomains inside of the zones on Route 53, but cirrus does not support that. I've made some minor change that add a second parameter that is the domain/zone to attempt updating. I suppose r53.py could be updated to find the best match, but adding a second parameter is fine for my purposes.

=== modified file 'bin/update_host.py'
--- bin/update_host.py 2011-10-04 19:30:34 +0000
+++ bin/update_host.py 2012-02-24 21:48:43 +0000
@@ -28,17 +28,14 @@
     return parser.parse_args()

 def main():
- usage = "usage: %prog <fqdn> <-c [cname] | -a [a record] | -A [Route 53 Alias]>"
+ usage = "usage: %prog <fqdn> <domain> <-c [cname] | -a [a record] | -A [Route 53 Alias]>"
     options, args = get_args(usage)
-
- if len(args) != 1:
+ print args
+ if len(args) != 2:
         print usage
         sys.exit(1)
     host = args[0] #host is fqdn
- if host.count('.') > 1:
- domain = host.split('.', 1)[1]
- else: #must be the domain root
- domain = host
+ domain = args[1] #domain is zone

     if not ( os.environ.has_key('AWS_ACCESS_ID') and os.environ.has_key('AWS_SECRET_KEY') ):
         log.error("Please set environment variables AWS_ACCESS_ID and AWS_SECRET_KEY")

Revision history for this message
Mark Rose (markrose) wrote :
Tim Kuhlman (timkuhlman)
Changed in cirrus:
assignee: nobody → Tim Kuhlman (timkuhlman)
Revision history for this message
Tim Kuhlman (timkuhlman) wrote :

Thanks for the patch! I modified it a bit so it will work either with 1 argument like before or with two and checked it in.

Changed in cirrus:
status: New → Fix Committed
Tim Kuhlman (timkuhlman)
Changed in cirrus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.