Skip to content

Commit

Permalink
Keeping lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
juditnovak committed Oct 16, 2023
1 parent cf688ee commit 6cb2efa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/charms/mongodb/v1/mongodb_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def _try_to_restore(self, backup_id: str) -> None:
restore_cmd = restore_cmd + remapping_args.split(" ")
self.charm.run_pbm_command(restore_cmd)
except (subprocess.CalledProcessError, ExecError) as e:
if type(e) is subprocess.CalledProcessError:
if isinstance(e, subprocess.CalledProcessError):
error_message = e.output.decode("utf-8")
else:
error_message = str(e.stderr)
Expand Down Expand Up @@ -560,7 +560,7 @@ def _try_to_backup(self):
)
return backup_id_match.group("backup_id") if backup_id_match else "N/A"
except (subprocess.CalledProcessError, ExecError) as e:
if type(e) is subprocess.CalledProcessError:
if isinstance(e, subprocess.CalledProcessError):
error_message = e.output.decode("utf-8")
else:
error_message = str(e.stderr)
Expand Down Expand Up @@ -642,7 +642,7 @@ def _get_backup_restore_operation_result(self, current_pbm_status, previous_pbm_
return f"Operation is still in progress: '{current_pbm_status.message}'"

if (
type(previous_pbm_status) is MaintenanceStatus
isinstance(previous_pbm_status, MaintenanceStatus)
and "backup id:" in previous_pbm_status.message
):
backup_id = previous_pbm_status.message.split("backup id:")[-1].strip()
Expand Down

0 comments on commit 6cb2efa

Please sign in to comment.