Configuration & Administration

Expand all | Collapse all

Deleting device properties that cause poskeyerrors

  • 1.  Deleting device properties that cause poskeyerrors

    Posted 10-11-2017 06:10 AM
    There has been an IRC discussion recently where a device's macaddresses attribute could not be deleted.  It first showed up as a poskeyerror that none of the toolbox tools could fix.  Problem, in this case, was to do with the macaddresses attrribute of the device.  Tried various things in zendmd to delete the device and its interfaces, none of which worked.   See http://zenpackers.readthedocs.io/en/latest/bad_relations.html   for some suggestions.

    In the end, cluther provided the right trick. In zendmd:
    device = find('<id of device>')
    device.macaddresses                                   (Gave the poskeyerror)

    device.macaddresses = None ; commit()
    for i in device.os.interfaces(): i.index_object() ; commit()

    cluther comments:
    "device.macaddresses is only there as a way to quickly lookup all of the MAC addresses on all of a device's interfaces without having to look at each interface. When the interfaces are indexed, they add their MAC address to their device's macaddresses property. In your case it seems that ZODB has lost track of that property (POSKeyError). Hopefully we can just replace it. "

    Cheers,
    Jane

    ------------------------------
    Jane Curry
    Skills 1st United Kingdom
    jane.curry@skills-1st.co.uk
    ------------------------------


  • 2.  RE: Deleting device properties that cause poskeyerrors

    Posted 13 days ago
    Thank you, this helped me to fix a very stubborn poskeyerror, I didn't know what to do with for a long time.

    ------------------------------
    Theodore Trubetskoy
    Skycreek Corp
    ------------------------------



  • 3.  RE: Deleting device properties that cause poskeyerrors

    Posted 12 days ago
    You are very welcome!

    Just a general heads-up to everyone, "cluther" doesn't often post here or on IRC but if he does - trust me - his posts are gold dust!

    Thanks "cluther".

    Cheers,
    Jane

    ------------------------------
    Jane Curry
    Skills 1st United Kingdom
    jane.curry@skills-1st.co.uk
    ------------------------------