66
77import argparse
88import os
9- import urlparse
10- from ZanataFunctions import logging_init
11- from ZanataFunctions import SshHost
12- from ZanataFunctions import UrlHelper
13- from JenkinsHelper import JenkinsJobBuild # noqa: E501,F401 # pylint: disable=unused-import
14- from JenkinsHelper import JenkinsServer
9+ import urlparse # pylint: disable=import-error
10+ # python3-pylint does not do well on importing python2 module
11+ from .ZanataFunctions import logging_init
12+ from .ZanataFunctions import SshHost
13+ from .ZanataFunctions import UrlHelper
14+ from .JenkinsHelper import JenkinsJobBuild # noqa: E501,F401 # pylint: disable=unused-import
15+ from .JenkinsHelper import JenkinsServer
1516
1617
1718class ZanataWar (object ):
@@ -52,7 +53,8 @@ def download(
5253 dest_dir = None ):
5354 # type (str, str) -> None
5455 """Download WAR file from .download_url"""
55- assert self .download_url , "war download_url is not set."
56+ if not self .download_url :
57+ raise AssertionError ("war download_url is not set." )
5658 target_file = dest_file
5759 if not target_file :
5860 url_dict = urlparse .urlparse (self .download_url )
@@ -62,7 +64,7 @@ def download(
6264 UrlHelper .download_file (self .download_url , target_file , target_dir )
6365 self .local_path = os .path .join (target_dir , target_file )
6466
65- def scp_to_server (
67+ def scp_to_server ( # pylint: disable=too-many-arguments
6668 self , dest_host ,
6769 dest_path = None ,
6870 identity_file = None ,
@@ -72,8 +74,10 @@ def scp_to_server(
7274 # type (str, str, str, bool, bool, str) -> None
7375 """SCP to Zanata server"""
7476 local_path = source_path if source_path else self .local_path
75- assert local_path , "source_path is missing"
76- assert os .path .isfile (local_path ), local_path + " does not exist"
77+ if not local_path :
78+ raise AssertionError ("source_path is missing" )
79+ if not os .path .isfile (local_path ):
80+ raise AssertionError (local_path + " does not exist" )
7781
7882 if dest_path :
7983 target_path = dest_path
@@ -190,5 +194,5 @@ def parse():
190194 # Set logging
191195 logging_init ()
192196
193- args = parse ()
197+ args = parse () # pylint: disable=invalid-name
194198 args .func ()
0 commit comments