Skip to content
This repository was 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.

Commit 9d5c8d9

Browse files
author
Jim Olsen
committed
merge develop branch for release 2.1.8
2 parents bf006fe + 10cc599 commit 9d5c8d9

File tree

5 files changed

+45
-30
lines changed

5 files changed

+45
-30
lines changed

BUILD/lib/script_definitions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165

166166
sname = 'tsat'
167167
scripts[sname] = {}
168-
scripts[sname]['docstring'] = 'Tanium Sensor Analysis Tool: asks a question for every sensor and saves theresults as CSV reports'
168+
scripts[sname]['docstring'] = 'Tanium Sensor Analysis Tool: asks a question for every sensor and saves the results as report files'
169169
scripts[sname]['script_name'] = sname
170170
scripts[sname]['pyopts'] = ''
171171
scripts[sname]['py_template'] = '${py_script}'

CHANGELOG.md

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
<!-- MarkdownTOC -->
22

3+
- [2.1.9](#219)
34
- [2.1.8](#218)
4-
- [2.1.7](#217)
55
- [enhancements](#enhancements)
6+
- [2.1.7](#217)
7+
- [enhancements](#enhancements-1)
68
- [doc updates](#doc-updates)
79
- [bug fixes](#bug-fixes)
810
- [work in progress](#work-in-progress)
911
- [notes](#notes)
1012
- [2.1.6](#216)
11-
- [enhancements](#enhancements-1)
13+
- [enhancements](#enhancements-2)
1214
- [2.1.5](#215)
1315
- [bug fixes](#bug-fixes-1)
14-
- [enhancements](#enhancements-2)
16+
- [enhancements](#enhancements-3)
1517
- [2.1.4](#214)
1618
- [bug fixes](#bug-fixes-2)
17-
- [enhancements](#enhancements-3)
19+
- [enhancements](#enhancements-4)
1820
- [doc updates](#doc-updates-1)
1921
- [test updates](#test-updates)
2022
- [2.1.3](#213)
21-
- [enhancements](#enhancements-4)
23+
- [enhancements](#enhancements-5)
2224
- [2.1.2](#212)
2325
- [bug fixes](#bug-fixes-3)
2426
- [2.1.1](#211)
25-
- [enhancements](#enhancements-5)
27+
- [enhancements](#enhancements-6)
2628
- [2.1.0](#210)
2729
- [bug fixes](#bug-fixes-4)
28-
- [enhancements](#enhancements-6)
30+
- [enhancements](#enhancements-7)
2931
- [doc updates](#doc-updates-2)
3032
- [2.0.3](#203)
3133
- [2.0.2](#202)
@@ -43,10 +45,18 @@
4345

4446
<!-- /MarkdownTOC -->
4547

46-
# 2.1.8
48+
# 2.1.9
4749

4850
[Development branch](https://github.com/tanium/pytan/tree/develop) on N/A
4951

52+
# 2.1.8
53+
54+
[Released](https://github.com/tanium/pytan/releases/tag/2.1.8) on Jan 19 2016
55+
56+
## enhancements
57+
* TSAT logging improvement: add file log handler to ALL loggers, not just TSAT log
58+
* added complete_pct arg for ask_manual to binsupport.py
59+
5060
# 2.1.7
5161

5262
[Released](https://github.com/tanium/pytan/releases/tag/2.1.7) on Dec 08 2015

TODO.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
* work on deploy action & start_seconds_from_now (a new action gets created at actual start time)
2525
* on 6.2, block info.json (block 444), fix _regex_for_body_element when _get_response tries to parse for server_version but it doesn't exist
2626
* param with \ at end breaks parameter parser regex
27+
* ~~ Will store value as global in TSAT
2728

2829
## GEN
29-
* TSAT re-vival
30+
* fix filename of datetime stamp in win
3031
* bring new session scripts into build system
3132
* 2.1.7: ask_saved:
3233
* add log for get_result_info in refresh_data path
@@ -43,6 +44,7 @@
4344
* question filters get params too?? (UNKNOWN)
4445
* add json source for parameters in TSAT
4546
* add export_obj option for csv to split columns longer than 32k
47+
* refactor utils/binsupport (3.x)
4648

4749
## TEST
4850
* add approve action to pytan (need doc update and test update)
@@ -61,12 +63,9 @@
6163
## LOW
6264
* bundle workflow capture into handler?
6365
* fix build bin doc to run on windows (figure out later)
64-
* write get_session_id.py (later)
65-
* update EXAMPLES to work with 2.0.0
6666
* look into update object methods (UNKNOWN)
6767
* logfile support (MEDIUM)
6868
* email out (MEDIUM)
6969
* add caching (HUGE)
7070
* figure out cert based auth/plugin based auth? (HUGE)
7171
* add RST output support to mdtester?
72-
* add os env overrides and/or add profile overrides

lib/pytan/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'''A python package that makes using the Tanium Server SOAP API easy.'''
55

66
__title__ = 'PyTan'
7-
__version__ = '2.1.7'
7+
__version__ = '2.1.8'
88
"""
99
Version of PyTan
1010
"""

lib/pytan/binsupport.py

+22-16
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,15 @@ def setup_ask_manual_argparser(doc):
16371637
help='Get the results after asking the quesiton '
16381638
'(default)',
16391639
)
1640+
group.add_argument(
1641+
'--complete_pct',
1642+
required=False,
1643+
type=float,
1644+
action='store',
1645+
default=pytan.pollers.QuestionPoller.COMPLETE_PCT_DEFAULT,
1646+
dest='complete_pct',
1647+
help='Percent to consider questions complete',
1648+
)
16401649
parser = add_ask_report_argparser(parser=parser)
16411650
return parser
16421651

@@ -2354,31 +2363,28 @@ def set_log_level(self):
23542363

23552364
def remove_file_log(self, logfile):
23562365
"""Utility to remove a log file from python's logging module"""
2366+
self.mylog.debug('Removing file logging to: {}'.format(logfile))
23572367
basename = os.path.basename(logfile)
23582368
root_logger = logging.getLogger()
2359-
try:
2360-
for x in root_logger.handlers:
2369+
all_loggers = pytan.utils.get_all_loggers()
2370+
for k, v in all_loggers.items():
2371+
for x in v.handlers:
23612372
if x.name == basename:
23622373
root_logger.removeHandler(x)
2363-
self.mylog.debug('Stopped file logging to: {}'.format(logfile))
2364-
except:
2365-
pass
23662374

23672375
def add_file_log(self, logfile):
23682376
"""Utility to add a log file from python's logging module"""
23692377
self.remove_file_log(logfile)
2370-
root_logger = logging.getLogger()
2378+
self.mylog.debug('Adding file logging to: {}'.format(logfile))
2379+
all_loggers = pytan.utils.get_all_loggers()
23712380
basename = os.path.basename(logfile)
2372-
try:
2373-
self.mylog.debug('Adding file logging to: {}'.format(logfile))
2374-
file_handler = logging.FileHandler(logfile)
2375-
file_handler.set_name(basename)
2376-
file_handler.setLevel(logging.DEBUG)
2377-
file_handler.setFormatter(logging.Formatter(self.FILE_INFO_FORMAT))
2378-
root_logger.addHandler(file_handler)
2379-
except Exception as e:
2380-
self.mylog.error('Problem setting up file logging to {}: {}'.format(logfile, e))
2381-
raise
2381+
file_handler = logging.FileHandler(logfile)
2382+
file_handler.set_name(basename)
2383+
file_handler.setLevel(logging.DEBUG)
2384+
file_handler.setFormatter(logging.Formatter(self.FILE_INFO_FORMAT))
2385+
for k, v in all_loggers.items():
2386+
v.addHandler(file_handler)
2387+
v.propagate = False
23822388

23832389
def set_mylog(self):
23842390
logging.Formatter.converter = time.gmtime

0 commit comments

Comments
 (0)