Skip to content

Commit 1204850

Browse files
authored
Merge pull request #775 from Tenebriso/py3_merge_fix
rebase py3 onto develop and fix the merge conflicts
2 parents 1f455dc + 267eaae commit 1204850

14 files changed

+6
-44
lines changed

hubblestack/daemon.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Main entry point for the hubble daemon
44
"""
55

6-
76
# import lockfile
87
import argparse
98
import copy
@@ -513,7 +512,6 @@ def _setup_signaling():
513512
signal.signal(signal.SIGHUP, clean_up_process)
514513
signal.signal(signal.SIGQUIT, clean_up_process)
515514

516-
517515
def _disable_boto_modules():
518516
""" Disable the unneeded boto modules because they cause issues with the loader """
519517
# Disable all of salt's boto modules, they give nothing but trouble to the loader

hubblestack/extmods/grains/fqdn.py

-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,5 @@ def _find_addr(interfaces):
7575
for ip_addr in ips:
7676
if ip_addr != '127.0.0.1':
7777
return {'local_ip4': ip_addr}
78-
7978
# Give up
8079
return {'local_ip4', ''}

hubblestack/log.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ def _remove_sensitive_info(obj, patterns_to_filter):
218218
Filter known sensitive info
219219
"""
220220
if isinstance(obj, dict):
221-
obj = {
222-
key: _remove_sensitive_info(value, patterns_to_filter)
223-
for key, value in obj.items()
224-
if not any(patt in key for patt in patterns_to_filter)}
221+
obj = {
222+
key: _remove_sensitive_info(value, patterns_to_filter)
223+
for key, value in obj.items()
224+
if not any(patt in key for patt in patterns_to_filter)}
225225
elif isinstance(obj, list):
226226
obj = [_remove_sensitive_info(item, patterns_to_filter)
227227
for item in obj]

hubblestack/status.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def get_hubble_status_opt(name, require_type=None):
9090
return opts
9191

9292

93+
9394
def get_hubble_or_salt_opt(name):
9495
"""return the option specified by name found in __opts__ or __opts__['hubble'] """
9596
if name in __opts__:
@@ -254,7 +255,7 @@ def mark(self, timestamp=None):
254255
timestamp = time.time()
255256
self = self.get_bucket(timestamp)
256257
else:
257-
if isinstance(timestamp, (str)):
258+
if isinstance(timestamp, str):
258259
timestamp = int(timestamp)
259260
self = self.get_bucket(timestamp)
260261
if timestamp < self.first_t:
@@ -412,9 +413,7 @@ def inner(*a, **kw):
412413
ret = func(*a, **kw)
413414
stat_handle.fin()
414415
return ret
415-
416416
return inner
417-
418417
if invoke:
419418
return decorator(invoke)
420419
return decorator

tests/unittests/test_grep_nova.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import sys
21
import os
3-
myPath = os.path.abspath(os.getcwd())
4-
sys.path.insert(0, myPath)
52
import hubblestack.files.hubblestack_nova.grep
63

74

tests/unittests/test_nebula_osquery.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import sys
21
import os
32
import json
43
import pytest
54

6-
myPath = os.path.abspath(os.getcwd())
7-
sys.path.insert(0, myPath)
8-
95
__salt__ = None
106

117
def dump_var_file(var, name='var', dumpster='tests/unittests/output'):

tests/unittests/test_pkg_nova.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import sys
21
import os
3-
myPath = os.path.abspath(os.getcwd())
4-
sys.path.insert(0, myPath)
52
import hubblestack.files.hubblestack_nova.pkg
63

74

tests/unittests/test_process.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11

22

33
import os
4-
import sys
54
import pytest
65
from collections import defaultdict
76

8-
myPath = os.path.abspath(os.getcwd())
9-
sys.path.insert(0, myPath)
10-
117
from salt.exceptions import ArgumentValueError
128
import hubblestack.extmods.fdg.process
139

tests/unittests/test_process_status.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
import mock
44
import os
5-
import sys
6-
7-
myPath = os.path.abspath(os.getcwd())
8-
sys.path.insert(0, myPath)
95

106
import hubblestack.extmods.fdg.process_status
117

tests/unittests/test_pulsar.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import sys
21
import os
3-
myPath = os.path.abspath(os.getcwd())
4-
sys.path.insert(0, myPath)
52
import hubblestack.extmods.modules.pulsar as pulsar
63
from salt.exceptions import CommandExecutionError
74

tests/unittests/test_readfile.py

-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33
import json
44
import os
5-
import sys
65
import yaml
76
import pytest
87

9-
myPath = os.path.abspath(os.getcwd())
10-
sys.path.insert(0, myPath)
118
import hubblestack.extmods.fdg.readfile
129

1310

tests/unittests/test_ssl_certificate.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# coding: utf-8
2-
import sys
32
import os
43
import ssl
54
import mock
6-
myPath = os.path.abspath(os.getcwd())
7-
sys.path.insert(0, myPath)
85
import hubblestack.extmods.fdg.ssl_certificate
96

107

tests/unittests/test_stat_nova.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import sys
21
import os
3-
myPath = os.path.abspath(os.getcwd())
4-
sys.path.insert(0, myPath)
52
import hubblestack.files.hubblestack_nova.stat_nova
63

74

tests/unittests/test_time_sync.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
import mock
44
import os
5-
import sys
6-
7-
myPath = os.path.abspath(os.getcwd())
8-
sys.path.insert(0, myPath)
95
import hubblestack.extmods.fdg.time_sync
106

117
class TestTimesync():

0 commit comments

Comments
 (0)