incubator-tashi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Gass <richardg...@gmail.com>
Subject Re: svn commit: r1245860 - /incubator/tashi/branches/stroucki-irpbugs/src/tashi/agents/dhcpdns.py
Date Mon, 20 Feb 2012 16:43:56 GMT
The key is generated manually or can be with the zoni install.

I modified the code but didn't update the irp base since I no longer
work there. When the irp code is updated, it should work.

Thanks

--
Richard

Sent from my mobile device

On Feb 20, 2012, at 10:34, Luke Jing Yuan <jyluke@mimos.my> wrote:

> If not mistaken the key is always generated as soon as you install the bind9 package.
>
> Richard, I assume then it would be similar to the one for Zoni as well?
>
> Regards,
> Luke
> ________________________________________
> From: Richard Gass [richardgass@gmail.com]
> Sent: 20 February 2012 15:09
> To: tashi-dev@incubator.apache.org
> Subject: Re: svn commit: r1245860 - /incubator/tashi/branches/stroucki-irpbugs/src/tashi/agents/dhcpdns.py
>
> I believe I removed the key file because it is not needed. You can
> specify the key in the config. If you use the file, the key needs to
> be in the working directory or something weird. I think it is best to
> remove.
>
> Thanks
>
> --
> Richard
>
> Sent from my mobile device
>
> On Feb 18, 2012, at 4:58, "stroucki@apache.org" <stroucki@apache.org> wrote:
>
>> Author: stroucki
>> Date: Sat Feb 18 03:58:08 2012
>> New Revision: 1245860
>>
>> URL: http://svn.apache.org/viewvc?rev=1245860&view=rev
>> Log:
>> dhcpdns: IRP uses a dns key file, would need to be integrated into mainline
>>
>> Modified:
>>   incubator/tashi/branches/stroucki-irpbugs/src/tashi/agents/dhcpdns.py
>>
>> Modified: incubator/tashi/branches/stroucki-irpbugs/src/tashi/agents/dhcpdns.py
>> URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-irpbugs/src/tashi/agents/dhcpdns.py?rev=1245860&r1=1245859&r2=1245860&view=diff
>> ==============================================================================
>> --- incubator/tashi/branches/stroucki-irpbugs/src/tashi/agents/dhcpdns.py (original)
>> +++ incubator/tashi/branches/stroucki-irpbugs/src/tashi/agents/dhcpdns.py Sat Feb
18 03:58:08 2012
>> @@ -28,8 +28,7 @@ from tashi import boolean
>> class DhcpDns(InstanceHook):
>>   def __init__(self, config, client, post=False):
>>       InstanceHook.__init__(self, config, client, post)
>> -        self.dnsKeyName = self.config.get('DhcpDns', 'dnsKeyName')
>> -        self.dnsSecretKey = self.config.get('DhcpDns', 'dnsSecretKey')
>> +        self.dnsKeyFile = self.config.get('DhcpDns', 'dnsKeyFile')
>>       self.dnsServer = self.config.get('DhcpDns', 'dnsServer')
>>       self.dnsDomain = self.config.get('DhcpDns', 'dnsDomain')
>>       self.dnsExpire = int(self.config.get('DhcpDns', 'dnsExpire'))
>> @@ -114,7 +113,6 @@ class DhcpDns(InstanceHook):
>>       except:
>>           pass
>>       cmd = "omshell"
>> -# XXXpipe: open omshell session
>>       (stdin, stdout) = os.popen2(cmd)
>>       stdin.write("server %s\n" % (self.dhcpServer))
>>       if (self.dhcpSecretKey != ""):
>> @@ -132,7 +130,6 @@ class DhcpDns(InstanceHook):
>>
>>   def removeDhcp(self, name, ipaddr=None):
>>       cmd = "omshell"
>> -# XXXpipe: open omshell session
>>       (stdin, stdout) = os.popen2(cmd)
>>       stdin.write("server %s\n" % (self.dhcpServer))
>>       if (self.dhcpSecretKey != ""):
>> @@ -154,12 +151,14 @@ class DhcpDns(InstanceHook):
>>           self.removeDns(name)
>>       except:
>>           pass
>> -        cmd = "nsupdate"
>> +        if (self.dnsKeyFile != ""):
>> +            cmd = "nsupdate -k %s" % (self.dnsKeyFile)
>> +        else:
>> +            cmd = "nsupdate"
>>       child = subprocess.Popen(args=cmd.split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE)
>>       try:
>>           (stdin, stdout) = (child.stdin, child.stdout)
>>           stdin.write("server %s\n" % (self.dnsServer))
>> -            stdin.write("key %s %s\n" % (self.dnsKeyName, self.dnsSecretKey))
>>           stdin.write("update add %s.%s %d A %s\n" % (name, self.dnsDomain, self.dnsExpire,
ip))
>>           stdin.write("\n")
>>           if (self.reverseDns):
>> @@ -180,12 +179,14 @@ class DhcpDns(InstanceHook):
>>               (pid, status) = os.waitpid(child.pid, os.WNOHANG)
>>
>>   def removeDns(self, name):
>> -        cmd = "nsupdate"
>> +        if (self.dnsKeyFile != ""):
>> +            cmd = "nsupdate -k %s" % (self.dnsKeyFile)
>> +        else:
>> +            cmd = "nsupdate"
>>       child = subprocess.Popen(args=cmd.split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE)
>>       try:
>>           (stdin, stdout) = (child.stdin, child.stdout)
>>           stdin.write("server %s\n" % (self.dnsServer))
>> -            stdin.write("key %s %s\n" % (self.dnsKeyName, self.dnsSecretKey))
>>           if (self.reverseDns):
>>               ip = socket.gethostbyname(name)
>>               ipSegments = map(int, ip.split("."))
>>
>>
> -----------------------------------------------
> A strategic agency under MOSTI
> www.mimos.my
> -----------------------------------------------

Mime
View raw message