snapctl 0.41.2__tar.gz → 0.41.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of snapctl might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: snapctl
3
- Version: 0.41.2
3
+ Version: 0.41.3
4
4
  Summary: Snapser CLI Tool
5
5
  Author: Ajinkya Apte
6
6
  Author-email: aj@snapser.com
@@ -419,10 +419,10 @@ snapctl byogs sync --help
419
419
  # $skip-build = true/false. Default is false. Pass this flag as true to skip the build and head straight to tag and push. Build step needs to run and tagged using the --tag you pass to the publish-image command for this to work.
420
420
  # $image_tag = An image tag for your snap. Note snapctl adds a timestamp, allowing you to use the same command.
421
421
  # $snapend_id = Snapend Id
422
- # $fleet_name = Fleet Name
422
+ # $fleet_names = Comma separated fleet names
423
423
  # Example:
424
- snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server --tag my-first-image --snapend-id "jxmmfryo" --fleet-name "my-fleet"
425
- snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-name $fleet_name
424
+ snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server --tag my-first-image --snapend-id "jxmmfryo" --fleet-names "my-fleet,my-second-fleet"
425
+ snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-names $fleet_names
426
426
  ```
427
427
 
428
428
  ### Game
@@ -400,10 +400,10 @@ snapctl byogs sync --help
400
400
  # $skip-build = true/false. Default is false. Pass this flag as true to skip the build and head straight to tag and push. Build step needs to run and tagged using the --tag you pass to the publish-image command for this to work.
401
401
  # $image_tag = An image tag for your snap. Note snapctl adds a timestamp, allowing you to use the same command.
402
402
  # $snapend_id = Snapend Id
403
- # $fleet_name = Fleet Name
403
+ # $fleet_names = Comma separated fleet names
404
404
  # Example:
405
- snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server --tag my-first-image --snapend-id "jxmmfryo" --fleet-name "my-fleet"
406
- snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-name $fleet_name
405
+ snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server --tag my-first-image --snapend-id "jxmmfryo" --fleet-names "my-fleet,my-second-fleet"
406
+ snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-names $fleet_names
407
407
  ```
408
408
 
409
409
  ### Game
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "snapctl"
3
- version = "0.41.2"
3
+ version = "0.41.3"
4
4
  description = "Snapser CLI Tool"
5
5
  authors = ["Ajinkya Apte <aj@snapser.com>"]
6
6
  readme = "README.md"
@@ -38,7 +38,7 @@ class ByoGs:
38
38
  tag: Union[str, None] = None, path: Union[str, None] = None,
39
39
  resources_path: Union[str, None] = None, dockerfile: Union[str, None] = None,
40
40
  skip_build: bool = False, snapend_id: Union[str, None] = None,
41
- fleet_name: Union[str, None] = None, blocking: bool = False
41
+ fleet_names: Union[str, None] = None, blocking: bool = False
42
42
  ) -> None:
43
43
  self.subcommand: str = subcommand
44
44
  self.base_url: str = base_url
@@ -58,7 +58,7 @@ class ByoGs:
58
58
  self.dockerfile: str = dockerfile
59
59
  self.skip_build: bool = skip_build
60
60
  self.snapend_id: Union[str, None] = snapend_id
61
- self.fleet_name: Union[str, None] = fleet_name
61
+ self.fleet_names: Union[str, None] = fleet_names
62
62
  self.blocking: bool = blocking
63
63
  # Validate input
64
64
  self.validate_input()
@@ -383,9 +383,9 @@ class ByoGs:
383
383
  snapctl_error(
384
384
  message="Missing required parameter: snapend_id",
385
385
  code=SNAPCTL_INPUT_ERROR)
386
- if not self.fleet_name:
386
+ if not self.fleet_names:
387
387
  snapctl_error(
388
- message="Missing required parameter: fleet_name",
388
+ message="Missing required parameter: fleet_names",
389
389
  code=SNAPCTL_INPUT_ERROR)
390
390
 
391
391
  # CRUD methods
@@ -448,10 +448,14 @@ class ByoGs:
448
448
  """
449
449
  self.tag = f'{self.tag}-{int(time.time())}'
450
450
  self.publish(no_exit=True)
451
- byogs_list: str = f"{self.fleet_name}:{self.tag}"
451
+ fleet_list: List[str] = self.fleet_names.split(',')
452
+ byogs_list: List[str] = []
453
+ for fleet in fleet_list:
454
+ byogs_list.append(f"{fleet.strip()}:{self.tag}")
452
455
  snapend = Snapend(
453
456
  subcommand='update', base_url=self.base_url, api_key=self.api_key,
454
- snapend_id=self.snapend_id, byogs=byogs_list, blocking=self.blocking
457
+ snapend_id=self.snapend_id, byogs=", ".join(map(str, byogs_list)),
458
+ blocking=self.blocking
455
459
  )
456
460
  snapend.update(no_exit=True)
457
461
  return snapctl_success(message='BYOGs sync successful')
@@ -2,7 +2,7 @@
2
2
  Constants used by snapctl
3
3
  """
4
4
  COMPANY_NAME = 'Snapser'
5
- VERSION = '0.41.2'
5
+ VERSION = '0.41.3'
6
6
  CONFIG_FILE_MAC = '~/.snapser/config'
7
7
  CONFIG_FILE_WIN = '%homepath%\\.snapser\\config'
8
8
 
@@ -1,7 +1,9 @@
1
- """
1
+ '''
2
2
  This file contains the endpoints for the Snapser API.
3
- """
4
- END_POINTS = {
3
+ '''
4
+ from typing import Dict
5
+
6
+ END_POINTS: Dict[str, str] = {
5
7
  'DEV': 'https://gateway.dev.snapser.io/snapser',
6
8
  'DEV_TWO': 'https://gateway.dev.snapser.io/devtwo',
7
9
  'PLAYTEST': 'https://gateway.dev.snapser.io/playtest',
@@ -266,11 +266,11 @@ def byogs(
266
266
  ),
267
267
  snapend_id: str = typer.Option(
268
268
  None, "--snapend-id",
269
- help=("(req: sync) Snapend Id. NOTE: Development Snapends only.")
269
+ help=("(req: sync) Snapend Id.")
270
270
  ),
271
- fleet_name: str = typer.Option(
272
- None, "--fleet-name",
273
- help=("(req: sync) Snapend Id. NOTE: Development Snapend fleets only. ")
271
+ fleet_names: str = typer.Option(
272
+ None, "--fleet-names",
273
+ help=("(req: sync) Comma separated fleet names.")
274
274
  ),
275
275
  blocking: bool = typer.Option(
276
276
  False, "--blocking",
@@ -301,7 +301,7 @@ def byogs(
301
301
  dockerfile=docker_file,
302
302
  skip_build=skip_build,
303
303
  snapend_id=snapend_id,
304
- fleet_name=fleet_name,
304
+ fleet_names=fleet_names,
305
305
  blocking=blocking
306
306
  )
307
307
  getattr(byogs_obj, subcommand.replace('-', '_'))()
File without changes
File without changes
File without changes
File without changes