Skip to content

Commit 9ba280e

Browse files
committed
ESC: post giant merge comment and future cleanup
1 parent e224f2a commit 9ba280e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+11
-175
lines changed

contrib/disk-queue-info.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import os
64
import argparse
75
import json

hubblestack/fileserver/azurefs.py

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
Do not include the leading ? for sas_token if generated from the web
4747
"""
4848

49-
# Import python libs
50-
5149
import base64
5250
import json
5351
import logging

hubblestack/fileserver/gitfs.py

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
.. _GitPython: https://github.com/gitpython-developers/GitPython
4949
"""
5050

51-
# Import python libs
5251
import logging
5352

5453
PER_REMOTE_OVERRIDES = (

hubblestack/fileserver/roots.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
configuration option.
1717
"""
1818

19-
# Import python libs
2019
import os
2120
import errno
2221
import logging

hubblestack/fileserver/s3fs.py

-4
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,17 @@
7878
https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html
7979
"""
8080

81-
# Import python libs
82-
8381
import datetime
8482
import os
8583
import time
8684
import pickle
8785
import logging
8886

89-
# Import salt libs
9087
import hubblestack.fileserver as fs
9188
import hubblestack.utils.files
9289
import hubblestack.utils.gzip_util
9390
import hubblestack.utils.hashutils
9491

95-
# Import 3rd-party libs
9692
# pylint: disable=import-error,no-name-in-module,redefined-builtin
9793
from urllib.parse import quote as _quote
9894
# pylint: enable=import-error,no-name-in-module,redefined-builtin

hubblestack/utils/atomicfile.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
atomic way
55
'''
66

7-
# Import python libs
87
import os
98
import tempfile
109
import sys

hubblestack/utils/gzip_util.py

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
Helper module for handling gzip consistently between 2.7+ and 2.6-
66
"""
77

8-
9-
# Import python libs
108
import gzip
119
import io
1210

hubblestack/utils/hashutils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33
A collection of hashing and encoding utils.
44
"""
5-
# Import python libs
5+
66
import hashlib
77

88
import hubblestack.utils.files

hubblestack/utils/itertools.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Helpful generators and other tools
44
'''
55

6-
# Import python libs
76
import fnmatch
87
import re
98

@@ -82,4 +81,4 @@ def fnmatch_multiple(candidates, pattern):
8281
return candidate
8382
except TypeError:
8483
pass
85-
return None
84+
return None

hubblestack/utils/path.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
lack of support for reading NTFS links.
55
'''
66

7-
# Import python libs
87
import logging
98
import collections
109
import os

hubblestack/utils/process.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Functions for daemonizing and otherwise modifying running processes
44
'''
55

6-
# Import python libs
76
import os
87
import time
98
import signal
@@ -62,4 +61,4 @@ def os_is_running(pid):
6261
os.kill(pid, 0) # SIG 0 is the "are you alive?" signal
6362
return True
6463
except OSError:
65-
return False
64+
return False

hubblestack/utils/s3.py

-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
"""
77

88

9-
# Import Python libs
109
import logging
1110

12-
# Import 3rd-party libs
1311
try:
1412
import requests
1513
HAS_REQUESTS = True # pylint: disable=W0612

hubblestack/utils/url.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
URL utils
44
'''
55

6-
# Import python libs
76
import re
87

9-
# Import salt libs
108
from urllib.parse import urlparse, urlunparse # pylint: disable=import-error,no-name-in-module
119
import hubblestack.utils.path
1210
import hubblestack.utils.platform
@@ -122,4 +120,4 @@ def strip_proto(url):
122120
Return a copy of the string with the protocol designation stripped, if one
123121
was present.
124122
'''
125-
return re.sub('^[^:/]+://', '', url)
123+
return re.sub('^[^:/]+://', '', url)

hubblestack/utils/user.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
belongs.
55
"""
66

7-
# Import Python libs
87
import getpass
98
import logging
109
import os

hubblestack/utils/validate/net.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
Various network validation utilities
44
'''
55

6-
# Import Python libs
76
import re
87
import socket
98

10-
# Import Salt libs
119
import hubblestack.utils.platform
1210

1311
if hubblestack.utils.platform.is_windows():

hubblestack/utils/validate/path.py

-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
Several path related validators
1010
'''
1111

12-
# Import python libs
1312
import os
1413

15-
1614
def is_writeable(path, check_parent=False):
1715
'''
1816
Check if a given path is writeable by the current user.

hubblestack/utils/validate/user.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Various user validation utilities
44
'''
55

6-
# Import python libs
76
import re
87
import logging
98

hubblestack/utils/win_functions.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"""
66
import re
77

8-
# Import 3rd Party Libs
98
try:
109
import psutil
1110
import pywintypes

hubblestack/utils/win_osinfo.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
'''
55
# http://stackoverflow.com/questions/32300004/python-ctypes-getting-0-with-getversionex-function
66

7-
# Import Third Party Libs
87
import ctypes
98
HAS_WIN32 = True
109
try:

hubblestack/utils/win_reg.py

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def __init__(self):
117117
'REG_OPTION_NON_VOLATILE': 0,
118118
'REG_OPTION_VOLATILE': 1
119119
}
120-
# Return Unicode due to from __future__ import unicode_literals
121120
self.vtype_reverse = {
122121
win32con.REG_BINARY: 'REG_BINARY',
123122
win32con.REG_DWORD: 'REG_DWORD',

tests/support/helpers.py

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
'''
1212
# pylint: disable=repr-flag-used-in-string,wrong-import-order
1313

14-
# Import Python libs
15-
from __future__ import absolute_import, print_function, unicode_literals
1614
import base64
1715
import errno
1816
import functools

tests/support/mixins.py

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
'''
1111
# pylint: disable=repr-flag-used-in-string
1212

13-
# Import python libs
14-
from __future__ import absolute_import, print_function
1513
import os
1614
import sys
1715
import time

tests/support/mock.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
'''
1515
# pylint: disable=unused-import,function-redefined,blacklisted-module,blacklisted-external-module
1616

17-
from __future__ import absolute_import
1817
import collections
1918
import copy
2019
import errno

tests/support/paths.py

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
Tests related paths
1212
'''
1313

14-
# Import python libs
15-
from __future__ import absolute_import
1614
import os
1715
import re
1816
import sys

tests/support/runtests.py

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
.. _`nose`: https://nose.readthedocs.org
4747
'''
4848

49-
# Import Python modules
50-
from __future__ import absolute_import, print_function
5149
import os
5250
import shutil
5351
import logging

tests/support/unit.py

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
'''
2222
# pylint: disable=unused-import,blacklisted-module,deprecated-method
2323

24-
# Import python libs
25-
from __future__ import absolute_import, print_function, unicode_literals
2624
import os
2725
import sys
2826
import logging

tests/unittests/grains/test_core.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
:codeauthor: Erik Johnson <[email protected]>
44
'''
55

6-
# Import Python libs
7-
from __future__ import absolute_import, print_function, unicode_literals
86
import logging
97
import os
108
import socket

tests/unittests/grains/test_disks.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
'''
33
:codeauthor: :email:`Shane Lee <[email protected]>`
44
'''
5-
# Import Python libs
6-
from __future__ import absolute_import, print_function, unicode_literals
5+
76
import textwrap
87

98
from tests.support.mixins import LoaderModuleMockMixin

tests/unittests/modules/test_aptpkg.py

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
versionadded:: 2017.7.0
77
'''
88

9-
# Import Python Libs
10-
from __future__ import absolute_import, print_function, unicode_literals
119
import copy
1210
import textwrap
1311

tests/unittests/modules/test_cmdmod.py

-4
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33
:codeauthor: Nicole Thomas <[email protected]>
44
'''
55

6-
# Import python libs
7-
from __future__ import absolute_import, print_function, unicode_literals
86
import os
97
import sys
108
import tempfile
119
import builtins
1210

13-
# Import Salt Libs
1411
import hubblestack.utils.files
1512
import hubblestack.utils.platform
1613
import hubblestack.modules.cmdmod as cmdmod
1714
from hubblestack.exceptions import CommandExecutionError
1815
from hubblestack.log import LOG_LEVELS
1916

20-
# Import Salt Testing Libs
2117
from tests.support.mixins import LoaderModuleMockMixin
2218
from tests.support.unit import TestCase, skipIf
2319
from tests.support.paths import FILES

tests/unittests/modules/test_debian_service.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
'''
33
:codeauthor: Rupesh Tare <[email protected]>
44
'''
5-
# Import Python libs
6-
from __future__ import absolute_import, print_function, unicode_literals
75

8-
# Import Salt Testing Libs
96
from tests.support.mixins import LoaderModuleMockMixin
107
from tests.support.unit import TestCase, skipIf
118
from tests.support.mock import (
@@ -15,7 +12,6 @@
1512
NO_MOCK_REASON
1613
)
1714

18-
# Import Salt Libs
1915
import hubblestack.modules.debian_service as debian_service
2016

2117

@@ -77,4 +73,4 @@ def test_enabled(self):
7773
'''
7874
mock = MagicMock(return_value=['A'])
7975
with patch.object(debian_service, 'get_enabled', mock):
80-
self.assertFalse(debian_service.enabled('name'))
76+
self.assertFalse(debian_service.enabled('name'))

tests/unittests/modules/test_gentoo_service.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
# Import Python libs
4-
from __future__ import absolute_import, print_function, unicode_literals
5-
6-
# Import Salt Testing Libs
73
from tests.support.mixins import LoaderModuleMockMixin
84
from tests.support.unit import TestCase, skipIf
95
from tests.support.mock import (
@@ -14,7 +10,6 @@
1410
call
1511
)
1612

17-
# Import Salt Libs
1813
import hubblestack.modules.gentoo_service as gentoo_service
1914

2015

tests/unittests/modules/test_linux_sysctl.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@
33
:codeauthor: jmoney <[email protected]>
44
"""
55

6-
# Import Python libs
7-
from __future__ import absolute_import, print_function, unicode_literals
8-
9-
# Import Salt Libs
106
import hubblestack.modules.linux_sysctl as linux_sysctl
117
import hubblestack.modules.systemd_service as systemd
128
from hubblestack.exceptions import CommandExecutionError
139

14-
# Import Salt Testing Libs
1510
from tests.support.mixins import LoaderModuleMockMixin
1611
from tests.support.mock import MagicMock, mock_open, patch
1712
from tests.support.unit import TestCase

tests/unittests/modules/test_mac_sysctl.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
:codeauthor: Nicole Thomas <[email protected]>
44
"""
55

6-
# Import Python libs
7-
from __future__ import absolute_import, print_function, unicode_literals
8-
9-
# Import Salt Libs
106
import hubblestack.modules.mac_sysctl as mac_sysctl
117
from hubblestack.exceptions import CommandExecutionError
128

13-
# Import Salt Testing Libs
149
from tests.support.mixins import LoaderModuleMockMixin
1510
from tests.support.mock import DEFAULT, MagicMock, mock_open, patch
1611
from tests.support.unit import TestCase

0 commit comments

Comments
 (0)