Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

2.2.0

Compare
Choose a tag to compare
@lifehackjim lifehackjim released this 27 Jun 22:00
· 15 commits to master since this release

2.2.0

Released on Jun 27 2017

bug fixes

  • lib directory updates:
    • requests and xmltodict now moved into lib/libs_external directory
    • lib/libs_external directory has support for multi-platform libraries, but not used as of yet - only "any" directory used
    • init.py in lib/pytan package now tries to import lib/libs_external directory before anything else
    • using requests[security] to overcome SSL oddities on OSX / other platforms
    • requests updated to latest version
    • xmltodict updated to latest version
    • ddt NOT updated to latest version, still lives in lib/ instead of lib/libs_external due to massive changes that break how pytan relies on ddt in testing suite

enhancements

  • PEP8/flake8 fixes:
    • lib/pytan/sessions.py
    • lib/pytan/handler.py
  • Modified default behavior of lib/pytan/sessions.py:Session.platform_is_6_5():
    • No longer assume that platform is 6.2
    • Will now default to assuming platform is 6.5 or greater
    • force_server_version can still be used to force pytan behavior to 6.2
  • Modified default behavior of lib/taniumpy/object_types/result_set.py:
    • 'Count' column will no longer be removed from CSV exports of Result Sets by default, need to supply remove_count=True as an argument to the CSV exporter in order to revert to old behavior
  • Callback support added to pytan.handler.Handler:
    • handle_cb is the new method added to handle callbacks
      • takes 3 arguments itself:
        • obj: the object to pass into a callback function and return
        • cb: the name of the callback to fetch from the callbacks dict argument in kwargs
        • kwargs: the extra arguments passed to the calling method
      • If a callback named "cb" is found in the callbacks dict argument in kwargs, that callback will be run with 3 arguments:
        • handler: the instantiated object of the handler itself
        • obj: the object that the callback method should return after modifying
        • kwargs: the extra arguments passed to the calling method
      • If a callback function fails, it will throw an exception. This behavior can be over-ridden by passing callback_exception_failure=False
    • _deploy_action now supports the following callbacks:
      • PackageDefinition: allows you to change the package definition dict object
      • ActionFilterDefinitions: allows you to change the action filter definitions list object
      • ActionOptionDefinitions: allows you to change the action option definitions list object
      • VerifyActionQuestion: allows you to change the verification question arguments dictionary if run=False
      • PreAddAction: allows you to change the Action object before it gets added
    • _ask_manual now supports the following callbacks:
      • SensorDefinitions: allows you to change the sensor definitions list object
      • QuestionFilterDefinitions: allows you to change the question filter definitions list object
      • QuestionOptionDefinitions: allows you to change the question option definitions list object
      • PreAddQuestion: allows you to change the Question object before it gets added
    • _add now supports the following callbacks:
      • PreAddObject: allows you to change ANY object before it gets added
    • More callbacks can be added throughout Handler with ease, please advise if you see the need for one somewhere
    • added EXAMPLES\POC\deploy_action_computer_groups.py as a proof to show callback support, specifically in deploy_action. Utilizies a callback function named handle_cgs that is an example PreAddAction callback that modifies the target_group of an Action if computer group names are supplied.