Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Update help message #357

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bank/account_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .exceptions import *
from .orm import Account, Allocation, DBConnection, Investment, Proposal
from .system import EmailTemplate, Slurm, SlurmAccount
from os import geteuid

Check notice on line 24 in bank/account_logic.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

bank/account_logic.py#L24

standard import "from os import geteuid" should be placed before "from dateutil.relativedelta import relativedelta"

Numeric = Union[int, float]
LOG = getLogger('bank.account_services')
Expand Down Expand Up @@ -1095,10 +1096,13 @@
"""Unlock the account on the given clusters

Args:
clusters: Name of the clusters to unlock the account on. Defaults to all clusters.
clusters: Name of the clusters to unlock the account on. Defaults to all clusters. Must have sudo privileges to execute.

Check notice on line 1099 in bank/account_logic.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

bank/account_logic.py#L1099

Line too long (132/120)
all_clusters: Lock the user on all clusters
"""

if geteuid() != 0:
exit("ERROR: `unlock` must be run with sudo privileges!")

self._set_account_lock(False, clusters, all_clusters)


Expand Down
4 changes: 2 additions & 2 deletions bank/cli/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@
"""

su_argument = dict(metavar='su', type=NonNegativeInt, default=0)
parser.add_argument('--all-clusters', **su_argument, help='service units awarded across all clusters')
parser.add_argument('--all-clusters', **su_argument, help='service units awarded/added/subtracted from all-clusters allocation, depending on invoked proposal operation')

Check notice on line 255 in bank/cli/parsers.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

bank/cli/parsers.py#L255

Line too long (177/120)

# Add per-cluster arguments for setting service units
for cluster in settings.clusters:
parser.add_argument(f'--{cluster}', **su_argument, help=f'service units awarded on the {cluster} cluster')
parser.add_argument(f'--{cluster}', **su_argument, help=f'service units awarded/added/subtracted on the {cluster} cluster, depending on invoked proposal operation')

Check notice on line 259 in bank/cli/parsers.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

bank/cli/parsers.py#L259

Line too long (176/120)


class InvestmentParser(BaseParser):
Expand Down
Loading