Skip to content

Commit

Permalink
Reduce redundant code
Browse files Browse the repository at this point in the history
Signed-off-by: TTz0601 <1375888477@qq.com>
  • Loading branch information
TTz0601 committed Aug 10, 2023
1 parent 35dc287 commit e2ad8fc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions avocado/utils/softwareraid.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ def __init__(self, name, level, disks, metadata, spare_disks=None):
self.metadata = metadata
self.disks = disks
self.remadd = ""
if not spare_disks:
self.spare_disks = []
else:
self.spare_disks = spare_disks
self.spare_disks = spare_disks or []

def _run_command(self, cmd, log_details=True, check_recovery=False):
if process.system(cmd, ignore_status=True, shell=True) != 0:
Expand Down Expand Up @@ -181,4 +178,4 @@ def exists(self):
result = process.run(cmd, shell=True, sudo=True, ignore_status=True)
if result.exit_status == 4:
return False
return True
return True

0 comments on commit e2ad8fc

Please sign in to comment.