fix pep8
diff --git a/setup.cfg b/setup.cfg
index 5466daa..53df199 100755
--- a/setup.cfg
+++ b/setup.cfg
@@ -17,6 +17,8 @@
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
+ Programming Language :: Python :: 3.9
+ Programming Language :: Python :: 3.10
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
@@ -35,4 +37,4 @@
wsgi_scripts =
staffeln-api-wsgi = staffeln.api:app
staffeln.database.migration_backend =
- sqlalchemy = staffeln.db.sqlalchemy.migration
\ No newline at end of file
+ sqlalchemy = staffeln.db.sqlalchemy.migration
diff --git a/staffeln/cmd/dbmanage.py b/staffeln/cmd/dbmanage.py
index d4706cf..5801a36 100644
--- a/staffeln/cmd/dbmanage.py
+++ b/staffeln/cmd/dbmanage.py
@@ -24,10 +24,12 @@
def add_command_parsers(subparsers):
- parser = subparsers.add_parser("create_schema", help="Create the database schema.")
+ parser = subparsers.add_parser(
+ "create_schema", help="Create the database schema.")
parser.set_defaults(func=DBCommand.create_schema)
- parser = subparsers.add_parser("upgrade", help="Upgrade the database schema.")
+ parser = subparsers.add_parser(
+ "upgrade", help="Upgrade the database schema.")
parser.add_argument("revision", nargs="?")
parser.set_defaults(func=DBCommand.do_upgrade)
diff --git a/staffeln/conductor/backup.py b/staffeln/conductor/backup.py
index 05f5cfd..8375bb5 100755
--- a/staffeln/conductor/backup.py
+++ b/staffeln/conductor/backup.py
@@ -252,10 +252,8 @@
backup = self.openstacksdk.get_backup(backup_object.backup_id)
if backup is None:
LOG.info(
- _(
- f"Backup {backup_object.backup_id} is removed from "
- "Openstack or cinder-backup is not existing in the cloud."
- )
+ f"Backup {backup_object.backup_id} is removed from "
+ "Openstack or cinder-backup is not existing in the cloud."
)
return backup_object.delete_backup()
if backup["status"] in ("available"):
@@ -269,15 +267,13 @@
# backup_object.delete_backup()
else: # "deleting", "restoring"
LOG.info(
- _(
- "Rotation for the backup %s is skipped in this cycle "
- "because it is in %s status"
- )
- % (backup_object.backup_id, backup["status"])
+ f"Rotation for the backup {backup_object.backup_id} "
+ "is skipped in this cycle "
+ f"because it is in {backup['status']} status"
)
except OpenstackSDKException as e:
- LOG.warn(_(f"Backup {backup_object.backup_id} deletion failed. {str(e)}"))
+ LOG.warn(f"Backup {backup_object.backup_id} deletion failed. {str(e)}")
# We don't delete backup object if any exception occured
# backup_object.delete_backup()
return False
@@ -288,12 +284,10 @@
project_id = backup_object.project_id
if project_id not in self.project_list:
LOG.warn(
- _(
- f"Project {project_id} for backup "
- f"{backup_object.backup_id} is not existing in "
- "Openstack. Please check your access right to this project. "
- "Skip this backup from remove now and will retry later."
- )
+ f"Project {project_id} for backup "
+ f"{backup_object.backup_id} is not existing in "
+ "Openstack. Please check your access right to this project. "
+ "Skip this backup from remove now and will retry later."
)
# Don't remove backup object, keep it and retry on next periodic task
# backup_object.delete_backup()
@@ -305,12 +299,9 @@
)
if backup is None:
LOG.info(
- _(
- "Backup %s is removed from Openstack "
- "or cinder-backup is not existing in the cloud. "
- "Start removing backup object from Staffeln."
- % backup_object.backup_id
- )
+ f"Backup {backup_object.backup_id} is removed from Openstack "
+ "or cinder-backup is not existing in the cloud. "
+ "Start removing backup object from Staffeln."
)
return backup_object.delete_backup()
@@ -322,10 +313,8 @@
LOG.debug(str(e))
else:
LOG.info(
- _(
- f"Backup {backup_object.backup_id} deletion failed. "
- "Skip this backup from remove now and will retry later."
- )
+ f"Backup {backup_object.backup_id} deletion failed. "
+ "Skip this backup from remove now and will retry later."
)
LOG.debug(f"deletion failed {str(e)}")
diff --git a/staffeln/conductor/result.py b/staffeln/conductor/result.py
index 34d9660..be07aff 100644
--- a/staffeln/conductor/result.py
+++ b/staffeln/conductor/result.py
@@ -68,14 +68,12 @@
"smtp_server_port": CONF.notification.smtp_server_port,
}
email.send(smtp_profile)
- LOG.info(_(f"Backup result email sent to {receiver}"))
+ LOG.info(f"Backup result email sent to {receiver}")
return True
except Exception as e:
LOG.warn(
- _(
- f"Backup result email send to {receiver} failed. "
- f"Please check email configuration. {str(e)}"
- )
+ f"Backup result email send to {receiver} failed. "
+ f"Please check email configuration. {str(e)}"
)
raise