Open derpadoo opened 7 years ago
It looks like the date needs to be in unix timestamp format (seconds), i.e. long
value according to the Nexpose API. It's not symmetrical, though, so I would argue this is just as much a bug in the Nexpose API itself since the formatted date is coming from Nexpose API itself.
Do you know how to access that variable to perhaps modify it before sending it back? All I can retrieve are the children of Tags which consist of id="15" name="MYTAG" type="CUSTOM". I can't figure out how to access the "param" variables yet.
The params are children elements of each tag, so would have to iterate on them until finding the one with name CREATION_DATE
and then modify the value.
<Tags>
<Tag id="15" name="MYTAG" type="CUSTOM">
<param name="CREATION_DATE" value="..."/>
<param name="COLOR" value="..."/>
<param ... />
</Tag>
</Tags>
Along with my other commits, experimenting with saving sites that have tags since they are deleted when re-saving the site.
Expected Behavior
Should pull existing site tags and save them back to site.
Current Behavior
Uncommented the "print as_string(as_xml(as_string(xml_data)))" in nexpose_site.py to view the XML data.
It tries to save a tag with the format:
and I narrowed it down to throwing an exception on the CREATION_DATE
EXCEPTION: For input string: "Thu Feb 20 13:02:01 CDT 2017"
Possible Solution
I don't know how it is pulling the "param" variables and are not experienced enough to parse the lxml object and remove them. Maybe the time format is wrong?
Steps to Reproduce (for bugs)
Python code that reproduces the issue...I can provide a PR of that would help. Updated nexpose_site.py
Context
Trying to save a site and keep the existing tags.
Your Environment