Skip to content

Commit ced0e95

Browse files
committed
Fixed example cname function call. Fixed function names calls in Client. Adjust host array in add_cname_to_record to match what is being returned by v1.0.6
1 parent 02d7d1b commit ced0e95

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

examples/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
r = dot.post('/host', host)
4646

4747
name = dot.get_host_by_name('foo')
48-
cname = dot.add_cname_record('foo','bar.foo.example.com')
48+
cname = dot.add_cname_to_record('foo','bar.foo.example.com')
4949
ipid = dot.get_host_by_ipid('11111')
5050
rrid = dot.get_host_by_rrid('11111')
5151

netdot/Client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,11 @@ def add_cname_to_record(self, name, cname):
372372
response = dot.add_cname_to_record('foo.example.com', 'bar.example.com')
373373
"""
374374
data = { 'cname': cname }
375-
host = self.getHostByName(name)
376-
for key in host[name]['RR'].iterkeys():
377-
for attr, attr_val in host[name]['RR'][key].iteritems():
375+
host = self.get_host_by_name(name)
376+
for key in host['RR'].iterkeys():
377+
for attr, attr_val in host['RR'][key].iteritems():
378378
if attr == 'name' and attr_val == name:
379-
return self.post("/host?rrid=" + host[name]['RR'][key]['id'], data)
379+
return self.post("/host?rrid=" + host['RR'][key]['id'], data)
380380

381381
def rename_host(self, old, new):
382382
"""
@@ -393,7 +393,7 @@ def rename_host(self, old, new):
393393
Usage:
394394
netdot.Client.renameHost('old-name','new-name')
395395
"""
396-
host = self.getHostByName(old)
396+
host = self.get_host_by_name(old)
397397
rrid = host['RR']['id']
398398
data = {}
399399
data['name'] = new

0 commit comments

Comments
 (0)