Skip to content

Instantly share code, notes, and snippets.

@bandit145
Created December 15, 2017 16:14
Show Gist options
  • Save bandit145/c823a7c860ce97d165308481facaaf68 to your computer and use it in GitHub Desktop.
Save bandit145/c823a7c860ce97d165308481facaaf68 to your computer and use it in GitHub Desktop.
example update_if_exists failure
from infoblox_client import objects, connector
import getpass
def main():
username = input('Username > ')
password = getpass.getpass('Password > ')
conn = connector.Connector({'host':'infoblox.example.com','username':username,'password':password,
'ssl_verify':False,'wapi_version':"1.7"})
host_record = objects.HostRecord
host_record.create(conn, ip=objects.IP.create('8.8.8.8'), view="Public View (PNS)", name="test.example.net",
configure_for_dns=True, ttl=None, comment=None,
extattrs=None)
#fails in wapi 1.7.1
host_record.create(conn, ip=objects.IP.create('8.8.4.4'), view="Public View (PNS)", name="test.example.net",
configure_for_dns=True, ttl=None, comment=None,
extattrs=None, update_if_exists=True)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment