Skip to content

Commit

Permalink
squash:beaker-job-group
Browse files Browse the repository at this point in the history
  • Loading branch information
skycastlelily committed Jan 7, 2025
1 parent 307cd90 commit 817aeee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ __ https://github.com/teemtee/docs/tree/main/logo

The :ref:`/plugins/provision/beaker` provision plugin gains
support for submitting jobs on behalf of a group through
``job-group`` key. The submitting user must be a member of
``beaker-job-group`` key. The submitting user must be a member of
the given job group.


Expand Down
2 changes: 1 addition & 1 deletion tmt/schemas/provision/beaker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ properties:
items:
type: string

job-group:
beaker-job-group:
type: string

required:
Expand Down
12 changes: 6 additions & 6 deletions tmt/steps/provision/mrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,9 +923,9 @@ class BeakerGuestData(tmt.steps.provision.GuestSshData):
multiple=True,
normalize=tmt.utils.normalize_string_list)

job_group: Optional[str] = field(
beaker_job_group: Optional[str] = field(
default=None,
option='--job-group',
option='--beaker-job-group',
metavar='GROUPNAME',
help="""
If set, Beaker jobs will be submitted on behalf of ``GROUPNAME``.
Expand Down Expand Up @@ -1091,7 +1091,7 @@ class GuestBeaker(tmt.steps.provision.GuestSsh):
kickstart: dict[str, str]

beaker_job_owner: Optional[str] = None
job_group: Optional[str] = None
beaker_job_group: Optional[str] = None

# Provided in Beaker response
job_id: Optional[str]
Expand Down Expand Up @@ -1170,7 +1170,7 @@ def _create(self, tmt_name: str) -> None:
whiteboard=self.whiteboard or tmt_name,
beaker_job_owner=self.beaker_job_owner,
public_key=self.public_key,
group=self.job_group)
group=self.beaker_job_group)

try:
response = self.api.create(data)
Expand All @@ -1193,13 +1193,13 @@ def _create(self, tmt_name: str) -> None:

if 'is not a valid group' in cause.faultString:
raise ProvisionError(
f"Failed to create Beaker job, job group '{self.job_group}' "
f"Failed to create Beaker job, job group '{self.beaker_job_group}' "
"was refused as unknown.") from exc

if 'is not a member of group' in cause.faultString:
raise ProvisionError(
"Failed to create Beaker job, submitting user is not "
"a member of group '{self.job_group}'") from exc
"a member of group '{self.beaker_job_group}'") from exc

raise ProvisionError('Failed to create Beaker job') from exc

Expand Down

0 comments on commit 817aeee

Please sign in to comment.