infobloxopen / infoblox-client

Infoblox NIOS Python WAPI Client
Apache License 2.0
142 stars 104 forks source link

AAAA Record Update not work #327

Closed yidianyipie closed 2 years ago

yidianyipie commented 2 years ago

Hi team,

I recently find the ipv6addr update not work

code blow:

   res = objects.AAAARecord.search_all(connector=self.conn, name=search_name, view=view)
    for i in res:
          print("-----oldipv6-----{ipv6addr}".format(ipv6addr=i.ipv6addr))
          print(
              "-----newipv6-----{ipv6addr}".format(ipv6addr=new_address))

          if i.ipv6addr == old_address:
              print("i.ipv6addr == old_address")
              i.ipv6addr = new_address
              print("i.ipv6addr:", i.ipv6addr)
              result = i.update()
              print("result: {result}".format(result=result))
          else:
              continue

And the result is original

-----oldipv6-----240e:e9:6001:0:58:213:97:223
-----newipv6-----240e:e9:6001:0:58:213:97:222
i.ipv6addr == old_address
i.ipv6addr: 240e:e9:6001:0:58:213:97:222
AAAARecord: ipv6addr="240e:e9:6001:0:58:213:97:222", name="ipv6123.swq.com.cn", view="default", _ref="record:aaaa/ZG5zLmJpbmRfYWFhYSQuX2RlZmF1bHQuY24uY29tLnN3cSxpcHY2MTIzLDI0MGU6ZTk6NjAwMTowOjU4OjIxMzo5NzoyMjM:ipv6123.swq.com.cn/default", ip="240e:e9:6001:0:58:213:97:222"
result: AAAARecord: ipv6addr="240e:e9:6001:0:58:213:97:223", name="ipv6123.swq.com.cn", view="default", _ref="record:aaaa/ZG5zLmJpbmRfYWFhYSQuX2RlZmF1bHQuY24uY29tLnN3cSxpcHY2MTIzLDI0MGU6ZTk6NjAwMTowOjU4OjIxMzo5NzoyMjM:ipv6123.swq.com.cn/default", ip="240e:e9:6001:0:58:213:97:223"

Could you please give some advice on it ?

BR Robin

sarya-infoblox commented 2 years ago

Hi @Guxing0321,

We are working on a new release right now, we will look at this issue as soon as we get time.

yidianyipie commented 2 years ago

Hi @sarya-infoblox

Thanks for your reply, hope for your update soon

BR Robin

sarya-infoblox commented 2 years ago

Hi @Guxing0321,

Earlier the update was not working on AAAARecord and we were working on the bug. Now, the issue is fixed and merged successfully. Just update your 'infoblox-client' plugin from GitHub as the code is yet to released on pip

Use the below method to update your AAAArecord,

a_s = objects.AAAARecord.search(conn, name="demo_test.com")

Updated the Record

    setattr(a_s, "ipv6addr", "1000::56")
    setattr(a_s, "name", "test_zone.com")
    setattr(a_s, "comment", "Modifiied")
    a_s.update()
    print("\n\nupdating record as:", a_s)
    # Search Updated
    u_s = objects.AAAARecord.search(conn, name="test_zone.com")
    print("\n\n Updated Record", u_s)

Let me know if this is working for you.

yidianyipie commented 2 years ago

Hi @sarya-infoblox

Thanks for your reply, the issue is resolved by your update. Thanks for your greate job

BR Robin