mirror of
https://git.proxmox.com/git/grub2
synced 2025-10-04 17:31:54 +00:00
debian/apport/source_grub2.py: Fix flake8 errors
This commit is contained in:
parent
e3c076c431
commit
598127c3f7
9
debian/apport/source_grub2.py
vendored
9
debian/apport/source_grub2.py
vendored
@ -23,6 +23,7 @@ from apport.hookutils import (
|
|||||||
path_to_key,
|
path_to_key,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def check_shell_syntax(path):
|
def check_shell_syntax(path):
|
||||||
''' Check the syntax of a shell script '''
|
''' Check the syntax of a shell script '''
|
||||||
try:
|
try:
|
||||||
@ -32,6 +33,7 @@ def check_shell_syntax(path):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def check_shell_syntax_harder(path):
|
def check_shell_syntax_harder(path):
|
||||||
''' Check the syntax of a shell script '''
|
''' Check the syntax of a shell script '''
|
||||||
try:
|
try:
|
||||||
@ -61,7 +63,7 @@ def check_shell_syntax_harder(path):
|
|||||||
def add_info(report):
|
def add_info(report):
|
||||||
if report['ProblemType'] == 'Package':
|
if report['ProblemType'] == 'Package':
|
||||||
# To detect if root fs is a loop device
|
# To detect if root fs is a loop device
|
||||||
attach_file(report, '/proc/cmdline','ProcCmdLine')
|
attach_file(report, '/proc/cmdline', 'ProcCmdLine')
|
||||||
attach_default_grub(report, 'EtcDefaultGrub')
|
attach_default_grub(report, 'EtcDefaultGrub')
|
||||||
attach_file_if_exists(report, '/boot/grub/device.map', 'DeviceMap')
|
attach_file_if_exists(report, '/boot/grub/device.map', 'DeviceMap')
|
||||||
try:
|
try:
|
||||||
@ -80,9 +82,9 @@ def add_info(report):
|
|||||||
|
|
||||||
# Check scripts in /etc/grub.d since some users directly change
|
# Check scripts in /etc/grub.d since some users directly change
|
||||||
# configuration there
|
# configuration there
|
||||||
grubdir='/etc/grub.d'
|
grubdir = '/etc/grub.d'
|
||||||
for f in os.listdir(grubdir):
|
for f in os.listdir(grubdir):
|
||||||
fullpath=os.path.join(grubdir, f)
|
fullpath = os.path.join(grubdir, f)
|
||||||
if f != 'README' and os.access(fullpath, os.X_OK) \
|
if f != 'README' and os.access(fullpath, os.X_OK) \
|
||||||
and not check_shell_syntax(fullpath):
|
and not check_shell_syntax(fullpath):
|
||||||
invalid_grub_script.append(fullpath)
|
invalid_grub_script.append(fullpath)
|
||||||
@ -93,6 +95,7 @@ def add_info(report):
|
|||||||
if invalid_grub_script:
|
if invalid_grub_script:
|
||||||
report['InvalidGrubScript'] = ' '.join(invalid_grub_script)
|
report['InvalidGrubScript'] = ' '.join(invalid_grub_script)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
r = {}
|
r = {}
|
||||||
r['ProblemType'] = 'Package'
|
r['ProblemType'] = 'Package'
|
||||||
|
4
debian/changelog
vendored
4
debian/changelog
vendored
@ -6,7 +6,9 @@ grub2 (2.04-2) UNRELEASED; urgency=medium
|
|||||||
|
|
||||||
[ Colin Watson ]
|
[ Colin Watson ]
|
||||||
* Use debhelper-compat instead of debian/compat.
|
* Use debhelper-compat instead of debian/compat.
|
||||||
* debian/apport/source_grub2.py: Avoid star import.
|
* debian/apport/source_grub2.py:
|
||||||
|
- Avoid star import.
|
||||||
|
- Fix flake8 errors.
|
||||||
|
|
||||||
-- Colin Watson <cjwatson@debian.org> Tue, 09 Jul 2019 15:04:41 +0100
|
-- Colin Watson <cjwatson@debian.org> Tue, 09 Jul 2019 15:04:41 +0100
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user