Skip to content

Commit

Permalink
fix(p4): Use correct hostname part for client name template
Browse files Browse the repository at this point in the history
  • Loading branch information
timniederhausen committed Jul 11, 2024
1 parent a47aef6 commit 7c6c400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scm_p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def format_client_name(checkout_path: str, parsed_url: PerforceWorkspaceUrl):
client_name_template = "{user}_{host}_{depot_path_as_name}_{suffix}"
return client_name_template.format(
user=parsed_url.username or os.environ.get('P4USER'),
host=socket.getfqdn().rpartition('.')[2],
host=socket.getfqdn().partition('.')[0],
depot_path_as_name=parsed_url.path[2:].replace('/', '_'),
suffix=zlib.crc32(checkout_path.encode('utf-8')))

Expand Down Expand Up @@ -207,7 +207,7 @@ def make_client_spec(ctx: P4Context,
if options is None:
options = []
if not host:
host = socket.getfqdn()
host = socket.getfqdn().partition('.')[0]
if not owner:
owner = ctx.user
if description is None:
Expand Down

0 comments on commit 7c6c400

Please sign in to comment.