poetry-plugin-ivcap 0.2.7__tar.gz → 0.2.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: poetry-plugin-ivcap
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: A custom Poetry command for IVCAP deployments
5
5
  License: MIT
6
6
  Author: Max Ott
@@ -11,6 +11,7 @@ SERVICE_ID_OPT = "service-id"
11
11
  SERVICE_FILE_OPT = "service-file"
12
12
  SERVICE_TYPE_OPT = "service-type"
13
13
  PORT_OPT = "port"
14
+ POLICY_OPT = "policy"
14
15
 
15
16
  DOCKER_RUN_TEMPLATE_OPT = "docker-run-template"
16
17
  DOCKER_RUN_OPT = "docker-run-opts"
@@ -44,11 +44,11 @@ class DockerConfig(BaseModel):
44
44
  def from_run_template(self, data, args, line) -> List[any]:
45
45
  pdata = data.get("tool", {}).get(PLUGIN_NAME, {})
46
46
  template = pdata.get(DOCKER_RUN_TEMPLATE_OPT)
47
+ smode = pdata.get(SERVICE_TYPE_OPT)
48
+ if smode is None:
49
+ line(f"<error>ERROR: 'service-type' is not defined in [{PLUGIN_NAME}]</error>")
50
+ sys.exit(1)
47
51
  if template is None:
48
- smode = pdata.get(SERVICE_TYPE_OPT)
49
- if smode is None:
50
- line(f"<error>ERROR: 'service-type' is not defined in [{PLUGIN_NAME}]</error>")
51
- sys.exit(1)
52
52
  if smode == "lambda":
53
53
  template = DOCKER_LAMBDA_RUN_TEMPLATE
54
54
  elif smode == "batch":
@@ -11,7 +11,7 @@ import tempfile
11
11
  import uuid
12
12
  import humanize
13
13
 
14
- from .constants import DEF_POLICY, PLUGIN_NAME, SERVICE_FILE_OPT, SERVICE_ID_OPT
14
+ from .constants import DEF_POLICY, PLUGIN_NAME, POLICY_OPT, SERVICE_FILE_OPT, SERVICE_ID_OPT
15
15
 
16
16
  from .docker import docker_cfg, docker_build, docker_push
17
17
  from .util import command_exists, get_name, string_to_number
@@ -124,7 +124,7 @@ def create_service_id(data, is_silent, line):
124
124
  return f"urn:ivcap:service:{id}"
125
125
 
126
126
  def get_policy(data, line):
127
- policy = data.get("tool", {}).get(PLUGIN_NAME, {}).get("policy")
127
+ policy = data.get("tool", {}).get(PLUGIN_NAME, {}).get(POLICY_OPT)
128
128
  if not policy:
129
129
  policy = DEF_POLICY
130
130
  return policy
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "poetry-plugin-ivcap"
3
- version = "0.2.7"
3
+ version = "0.2.8"
4
4
  description = "A custom Poetry command for IVCAP deployments"
5
5
  authors = ["Max Ott <max.ott@csiro.au>"]
6
6
  license = "MIT"