mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 08:35:21 +00:00
Lint and syntax fixes
This commit is contained in:
parent
5e1dba88c7
commit
0de35b51cc
@ -43,7 +43,7 @@ extension-pkg-whitelist=
|
|||||||
|
|
||||||
# Fileperms Lint Plugin Settings
|
# Fileperms Lint Plugin Settings
|
||||||
fileperms-default=0644
|
fileperms-default=0644
|
||||||
fileperms-ignore-paths=tests/runtests.py,tests/jenkins*.py,tests/saltsh.py,tests/buildpackage.py
|
fileperms-ignore-paths=setup.py,tests/runtests.py,tests/jenkins*.py,tests/saltsh.py,tests/buildpackage.py
|
||||||
|
|
||||||
# Minimum Python Version To Enforce
|
# Minimum Python Version To Enforce
|
||||||
minimum-python-version = 2.7
|
minimum-python-version = 2.7
|
||||||
|
@ -40,7 +40,7 @@ extension-pkg-whitelist=
|
|||||||
|
|
||||||
# Fileperms Lint Plugin Settings
|
# Fileperms Lint Plugin Settings
|
||||||
fileperms-default=0644
|
fileperms-default=0644
|
||||||
fileperms-ignore-paths=tests/runtests.py,tests/jenkins*.py,tests/saltsh.py,tests/buildpackage.py
|
fileperms-ignore-paths=setup.py,tests/runtests.py,tests/jenkins*.py,tests/saltsh.py,tests/buildpackage.py
|
||||||
|
|
||||||
# Minimum Python Version To Enforce
|
# Minimum Python Version To Enforce
|
||||||
minimum-python-version = 2.7
|
minimum-python-version = 2.7
|
||||||
|
30
setup.py
30
setup.py
@ -4,12 +4,12 @@
|
|||||||
The setup script for salt
|
The setup script for salt
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from __future__ import absolute_import
|
# pylint: disable=file-perms,ungrouped-imports,wrong-import-order,wrong-import-position,repr-flag-used-in-string
|
||||||
# pylint: disable=file-perms
|
# pylint: disable=3rd-party-local-module-not-gated
|
||||||
# pylint: disable=C0111,E1101,E1103,F0401,W0611,W0201,W0232,R0201,R0902,R0903
|
# pylint: disable=C0111,E1101,E1103,F0401,W0611,W0201,W0232,R0201,R0902,R0903
|
||||||
|
|
||||||
# For Python 2.5. A no-op on 2.6 and above.
|
# For Python 2.5. A no-op on 2.6 and above.
|
||||||
from __future__ import print_function, with_statement
|
from __future__ import absolute_import, print_function, with_statement
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -396,12 +396,13 @@ class InstallPyCryptoWindowsWheel(Command):
|
|||||||
with indent_log():
|
with indent_log():
|
||||||
call_subprocess(call_arguments)
|
call_subprocess(call_arguments)
|
||||||
|
|
||||||
|
|
||||||
def uri_to_resource(resource_file):
|
def uri_to_resource(resource_file):
|
||||||
### Returns the URI for a resource
|
# ## Returns the URI for a resource
|
||||||
# The basic case is that the resource is on saltstack.com
|
# The basic case is that the resource is on saltstack.com
|
||||||
# It could be the case that the resource is cached.
|
# It could be the case that the resource is cached.
|
||||||
salt_uri = 'https://repo.saltstack.com/windows/dependencies/' + resource_file
|
salt_uri = 'https://repo.saltstack.com/windows/dependencies/' + resource_file
|
||||||
if os.getenv('SALTREPO_LOCAL_CACHE') == None:
|
if os.getenv('SALTREPO_LOCAL_CACHE') is None:
|
||||||
# if environment variable not set, return the basic case
|
# if environment variable not set, return the basic case
|
||||||
return salt_uri
|
return salt_uri
|
||||||
if not os.path.isdir(os.getenv('SALTREPO_LOCAL_CACHE')):
|
if not os.path.isdir(os.getenv('SALTREPO_LOCAL_CACHE')):
|
||||||
@ -410,14 +411,14 @@ def uri_to_resource(resource_file):
|
|||||||
cached_resource = os.path.join(os.getenv('SALTREPO_LOCAL_CACHE'), resource_file)
|
cached_resource = os.path.join(os.getenv('SALTREPO_LOCAL_CACHE'), resource_file)
|
||||||
cached_resource = cached_resource.replace('/', '\\')
|
cached_resource = cached_resource.replace('/', '\\')
|
||||||
if not os.path.isfile(cached_resource):
|
if not os.path.isfile(cached_resource):
|
||||||
# if file does not exist, return the basic case
|
# if file does not exist, return the basic case
|
||||||
return salt_uri
|
return salt_uri
|
||||||
if os.path.getsize(cached_resource) == 0:
|
if os.path.getsize(cached_resource) == 0:
|
||||||
# if file has zero size, return the basic case
|
# if file has zero size, return the basic case
|
||||||
return salt_uri
|
return salt_uri
|
||||||
return cached_resource
|
return cached_resource
|
||||||
|
|
||||||
|
|
||||||
class InstallCompiledPyYaml(Command):
|
class InstallCompiledPyYaml(Command):
|
||||||
|
|
||||||
description = 'Install PyYAML on Windows'
|
description = 'Install PyYAML on Windows'
|
||||||
@ -427,7 +428,6 @@ class InstallCompiledPyYaml(Command):
|
|||||||
|
|
||||||
def finalize_options(self):
|
def finalize_options(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if getattr(self.distribution, 'salt_installing_pyyaml_windows', None) is None:
|
if getattr(self.distribution, 'salt_installing_pyyaml_windows', None) is None:
|
||||||
@ -503,7 +503,7 @@ class DownloadWindowsDlls(Command):
|
|||||||
while True:
|
while True:
|
||||||
chunk = req.read(4096)
|
chunk = req.read(4096)
|
||||||
if len(chunk) == 0:
|
if len(chunk) == 0:
|
||||||
break;
|
break
|
||||||
wfh.write(chunk)
|
wfh.write(chunk)
|
||||||
wfh.flush()
|
wfh.flush()
|
||||||
else:
|
else:
|
||||||
@ -544,7 +544,7 @@ class Sdist(sdist):
|
|||||||
os.unlink(PACKAGED_FOR_SALT_SSH_FILE)
|
os.unlink(PACKAGED_FOR_SALT_SSH_FILE)
|
||||||
|
|
||||||
|
|
||||||
class CloudSdist(Sdist):
|
class CloudSdist(Sdist): # pylint: disable=too-many-ancestors
|
||||||
user_options = Sdist.user_options + [
|
user_options = Sdist.user_options + [
|
||||||
('download-bootstrap-script', None,
|
('download-bootstrap-script', None,
|
||||||
'Download the latest stable bootstrap-salt.sh script. This '
|
'Download the latest stable bootstrap-salt.sh script. This '
|
||||||
@ -564,7 +564,7 @@ class CloudSdist(Sdist):
|
|||||||
def finalize_options(self):
|
def finalize_options(self):
|
||||||
Sdist.finalize_options(self)
|
Sdist.finalize_options(self)
|
||||||
if 'SKIP_BOOTSTRAP_DOWNLOAD' in os.environ:
|
if 'SKIP_BOOTSTRAP_DOWNLOAD' in os.environ:
|
||||||
log('Please stop using \'SKIP_BOOTSTRAP_DOWNLOAD\' and use '
|
log('Please stop using \'SKIP_BOOTSTRAP_DOWNLOAD\' and use ' # pylint: disable=not-callable
|
||||||
'\'DOWNLOAD_BOOTSTRAP_SCRIPT\' instead')
|
'\'DOWNLOAD_BOOTSTRAP_SCRIPT\' instead')
|
||||||
|
|
||||||
if 'DOWNLOAD_BOOTSTRAP_SCRIPT' in os.environ:
|
if 'DOWNLOAD_BOOTSTRAP_SCRIPT' in os.environ:
|
||||||
@ -978,7 +978,7 @@ class SaltDistribution(distutils.dist.Distribution):
|
|||||||
'virt/*.jinja',
|
'virt/*.jinja',
|
||||||
'git/*',
|
'git/*',
|
||||||
'lxc/*',
|
'lxc/*',
|
||||||
]}
|
]}
|
||||||
if not IS_WINDOWS_PLATFORM:
|
if not IS_WINDOWS_PLATFORM:
|
||||||
package_data['salt.cloud'] = ['deploy/*.sh']
|
package_data['salt.cloud'] = ['deploy/*.sh']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user