|
Lines 70-76
Link Here
|
| 70 |
self.domainname = domainname |
70 |
self.domainname = domainname |
| 71 |
|
71 |
|
| 72 |
def __str__(self): |
72 |
def __str__(self): |
| 73 |
msg = _('`nsupdate` existence check for domain {domain} failed.') |
73 |
msg = _('`nsupdate` check for domain {domain} failed.') |
| 74 |
return msg.format(domain=self.domainname) |
74 |
return msg.format(domain=self.domainname) |
| 75 |
|
75 |
|
| 76 |
|
76 |
|
|
Lines 88-96
Link Here
|
| 88 |
|
88 |
|
| 89 |
|
89 |
|
| 90 |
def nsupdate(hostname, domainname): |
90 |
def nsupdate(hostname, domainname): |
| 91 |
process = subprocess.Popen(('nsupdate', '-g'), stdin=subprocess.PIPE, |
91 |
process = subprocess.Popen(('nsupdate', '-g' , '-t', '15'), stdin=subprocess.PIPE, |
| 92 |
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
92 |
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| 93 |
cmd = 'server {host}.{domain}\nprereq yxdomain {domain}\n' |
93 |
cmd = 'server {host}.{domain}\nprereq yxdomain {domain}\nsend\n' |
| 94 |
_ = process.communicate(cmd.format(host=hostname, domain=domainname)) |
94 |
_ = process.communicate(cmd.format(host=hostname, domain=domainname)) |
| 95 |
if process.poll() != 0: |
95 |
if process.poll() != 0: |
| 96 |
raise NSUpdateError(hostname, domainname) |
96 |
raise NSUpdateError(hostname, domainname) |