1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-20 18:50:17 +03:00

In windows.py fixes:

--------------------
  - singleton-comparison / Comparison to None should be 'expr is not None'

Int util/rpm.py fixes:
----------------------
  - Line: 19 pylint: wrong-import-order / standard import "import subprocess"
                                        should be placed before "import rpm"
  - Few Lines:  expected 2 blank lines
This commit is contained in:
Viktor Volkov 2020-01-17 17:41:27 +04:00
parent 54d7f78f71
commit 7abe9d6468
3 changed files with 7 additions and 3 deletions

View File

@ -15,8 +15,9 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import rpm
import subprocess
import rpm
def is_rpm_installed(rpm_name):
'''
@ -30,12 +31,14 @@ def is_rpm_installed(rpm_name):
return False
def update():
'''
Update APT-RPM database.
'''
subprocess.check_call(['/usr/bin/apt-get', 'update'])
def install_rpm(rpm_name):
'''
Install RPM from APT-RPM sources.
@ -43,6 +46,7 @@ def install_rpm(rpm_name):
update()
subprocess.check_call(['/usr/bin/apt-get', '-y', 'install', rpm_name])
def remove_rpm(rpm_name):
'''
Remove RPM from file system.

View File

@ -86,7 +86,7 @@ def with_privileges(username, func):
current_uid = os.getuid()
current_groups = os.getgrouplist('root', 0)
if not 0 == current_uid:
if not current_uid == 0:
raise Exception('Not enough permissions to drop privileges')
user_uid = pwd.getpwnam(username).pw_uid

View File

@ -56,7 +56,7 @@ class smbcreds:
try:
samba_dc = get_dc_hostname(self.creds, self.lp)
if samba_dc != dc_fqdn and dc_fqdn != None:
if samba_dc != dc_fqdn and dc_fqdn is not None:
logging.debug(
slogm('Samba DC setting is {} and is overwritten by user setting {}'.format(