Skip to content

Commit

Permalink
Merge 72ba835 into 6c5ebc2
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidalgarcia committed Oct 26, 2020
2 parents 6c5ebc2 + 72ba835 commit dffc568
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
7 changes: 5 additions & 2 deletions reana_db/cli.py
Expand Up @@ -213,7 +213,8 @@ def create_default_resources():
created_resources = Resource.initialise_default_resources()
if created_resources:
click.secho(
f"Created resources: {[r.name for r in created_resources]}", fg="green"
"Created resources: {}".format([r.name for r in created_resources]),
fg="green",
)
else:
click.secho(
Expand All @@ -230,7 +231,9 @@ def disk_usage_update():
click.secho("Users disk quota usage updated successfully.", fg="green")
except Exception as e:
click.secho(
f"[ERROR]: An error occurred when updating users disk quota usage: {repr(e)}",
"[ERROR]: An error occurred when updating users disk quota usage: {}".format(
repr(e)
),
fg="red",
)
sys.exit(1)
10 changes: 6 additions & 4 deletions reana_db/models.py
Expand Up @@ -158,8 +158,8 @@ def _get_health_status(usage, limit):
if unit and unit != user_resource.resource.unit:
raise Exception(
"Error while calculating quota usage. Not all "
f"resources of resource type {resource_type} use "
"the same units."
"resources of resource type {} use "
"the same units.".format(resource_type)
)
unit = user_resource.resource.unit
quota_usage += user_resource.quota_used
Expand Down Expand Up @@ -521,7 +521,9 @@ def _format_disk_usage(bytes_, block_size):
# TODO: Change when https://github.com/reanahub/reana-server/issues/296
# gets implemented.
size = (
f"{bytes_}B" if block_size == "b" else f"{round(bytes_/1024, 2)}K"
"{}B".format(bytes_)
if block_size == "b"
else "{}K".format(round(bytes_ / 1024, 2))
)
else:
size = str(bytes_)
Expand Down Expand Up @@ -769,7 +771,7 @@ def initialise_default_resources():
name=name,
type_=ResourceType[type_],
unit=resource_type_to_unit[ResourceType[type_]],
title=f"Default {type_} resource.",
title="Default {} resource.".format(type_),
)
)

Expand Down
4 changes: 3 additions & 1 deletion reana_db/utils.py
Expand Up @@ -223,7 +223,9 @@ def get_default_quota_resource(resource_type):
from reana_db.models import Resource

if resource_type not in DEFAULT_QUOTA_RESOURCES.keys():
raise Exception(f"Default resource of type {resource_type} does not exist.")
raise Exception(
"Default resource of type {} does not exist.".format(resource_type)
)

return Resource.query.filter_by(name=DEFAULT_QUOTA_RESOURCES[resource_type]).one()

Expand Down
2 changes: 1 addition & 1 deletion reana_db/version.py
Expand Up @@ -14,4 +14,4 @@

from __future__ import absolute_import, print_function

__version__ = "0.8.0a6"
__version__ = "0.8.0a7"
2 changes: 1 addition & 1 deletion tests/conftest.py
Expand Up @@ -53,7 +53,7 @@ def _run_workflow(time_elapsed_seconds=0.5):
id_ = uuid4()
workflow = Workflow(
id_=str(id_),
name=f"test_{id_}",
name="test_{}".format(id_),
owner_id=new_user.id_,
reana_specification=[],
type_="serial",
Expand Down

0 comments on commit dffc568

Please sign in to comment.