Skip to content

Commit

Permalink
[inventory] Fix variables defined as a tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Volak committed Nov 28, 2023
1 parent 576057a commit 373f8ee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
40 changes: 20 additions & 20 deletions inventory/python/frinx_worker/inventory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class WorkerInput(TaskInput):

class WorkerOutput(TaskOutput):
query: str
variable: Optional[DictAny]
variable: Optional[DictAny] = None
response_code: int
response_body: Any

Expand Down Expand Up @@ -208,7 +208,7 @@ class WorkerInput(TaskInput):

class WorkerOutput(TaskOutput):
query: str
variable: Optional[DictAny]
variable: Optional[DictAny] = None
response_code: int
response_body: Any

Expand Down Expand Up @@ -286,7 +286,7 @@ class WorkerInput(TaskInput):

class WorkerOutput(TaskOutput):
query: str
variable: Optional[DictAny]
variable: Optional[DictAny] = None
response_code: int
response_body: Any

Expand Down Expand Up @@ -380,7 +380,7 @@ class WorkerInput(TaskInput):

class WorkerOutput(TaskOutput):
query: str
variable: Optional[DictAny]
variable: Optional[DictAny] = None
response_body: Any

@classmethod
Expand Down Expand Up @@ -448,7 +448,7 @@ class WorkerInput(TaskInput):

class WorkerOutput(TaskOutput):
query: str
variable: Optional[DictAny]
variable: Optional[DictAny] = None
response_code: int
response_body: Any

Expand Down Expand Up @@ -506,7 +506,7 @@ class WorkerInput(TaskInput):
class WorkerOutput(TaskOutput):
labels_id: DictStr
query: str
variable: Optional[DictAny]
variable: Optional[DictAny] = None

def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]:

Expand Down Expand Up @@ -559,7 +559,7 @@ class WorkerInput(TaskInput):

class WorkerOutput(TaskOutput):
query: str
variable: Optional[DictAny]
variable: Optional[DictAny] = None
response_body: Any

def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]:
Expand Down Expand Up @@ -610,14 +610,14 @@ class WorkerInput(TaskInput):
blueprint_id: Optional[str] = None
address: Optional[str] = None
port: Optional[int] = None
username: Optional[str]
username: Optional[str] = None
password: Optional[str] = None
version: Optional[str] = None
device_type: Optional[str] = None

class WorkerOutput(TaskOutput):
query: str
variable: Optional[DictAny]
variable: Optional[DictAny] = None
response_body: Any

@staticmethod
Expand Down Expand Up @@ -645,36 +645,36 @@ def execute(self, worker_input: WorkerInput) -> TaskResult[WorkerOutput]:

self.add_device.input.name = worker_input.device_name
self.add_device.input.zone_id = worker_input.zone_id
self.add_device.input.service_state = worker_input.service_state,
self.add_device.input.device_size = worker_input.device_size,
self.add_device.input.service_state = worker_input.service_state
self.add_device.input.device_size = worker_input.device_size
self.add_device.input.mount_parameters = str(worker_input.mount_parameters).replace("'", '\\"')

if worker_input.label_ids:
self.add_device.input.label_ids = worker_input.label_ids,
self.add_device.input.label_ids = worker_input.label_ids

if worker_input.vendor:
self.add_device.input.vendor = worker_input.vendor,
self.add_device.input.vendor = worker_input.vendor

if worker_input.model:
self.add_device.input.model = worker_input.model,
self.add_device.input.model = worker_input.model

if worker_input.device_type:
self.add_device.input.device_type = worker_input.device_type,
self.add_device.input.device_type = worker_input.device_type

if worker_input.version:
self.add_device.input.version = worker_input.version,
self.add_device.input.version = worker_input.version

if worker_input.address:
self.add_device.input.address = worker_input.address,
self.add_device.input.address = worker_input.address

if worker_input.port:
self.add_device.input.port = worker_input.port,
self.add_device.input.port = worker_input.port

if worker_input.username:
self.add_device.input.username = worker_input.username,
self.add_device.input.username = worker_input.username

if worker_input.password:
self.add_device.input.password = worker_input.password,
self.add_device.input.password = worker_input.password

query = self.add_device.render()

Expand Down
2 changes: 1 addition & 1 deletion inventory/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ packages = [{ include = "frinx_worker" }]
name = "frinx-inventory-worker"
description = "Conductor worker for Frinx Device Inventory"
authors = ["Jozef Volak <[email protected]>"]
version = "1.0.0"
version = "1.0.1"
readme = ["README.md", "CHANGELOG.md", "RELEASE.md"]
keywords = ["frinx-machine", "device inventory", "worker"]
license = "Apache 2.0"
Expand Down

0 comments on commit 373f8ee

Please sign in to comment.