Skip to content

Commit

Permalink
Merge pull request #267 from rapyuta-robotics/devel
Browse files Browse the repository at this point in the history
🎉 release: v7.0.2
  • Loading branch information
ankitrgadiya authored Feb 2, 2024
2 parents 1a1fd5a + be26ff8 commit e59e50f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
5 changes: 4 additions & 1 deletion riocli/apply/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ def _get_attr(obj, accept_keys):
@staticmethod
def _get_object_key(obj: dict) -> str:
kind = obj.get('kind').lower()
name_or_guid = obj['metadata']['name']
name_or_guid = obj.get('metadata', {}).get('name')

if not name_or_guid:
raise ValueError('[kind:{}] name is required.'.format(kind))

return '{}:{}'.format(kind, name_or_guid)
5 changes: 3 additions & 2 deletions riocli/deployment/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ def fetch_deployments(
DeploymentPhaseConstants.PROVISIONING])
result = []
for deployment in deployments:
if (include_all or
if (include_all or deployment_name_or_regex == deployment.name or
deployment_name_or_regex == deployment.deploymentId or
re.search(deployment_name_or_regex, deployment.name)):
(deployment_name_or_regex not in deployment.name and
re.search(deployment_name_or_regex, deployment.name))):
result.append(deployment)

return result
Expand Down
6 changes: 4 additions & 2 deletions riocli/device/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ def fetch_devices(
devices = client.get_all_devices(online_device=online_devices)
result = []
for device in devices:
if (include_all or device_name_or_regex == device.uuid or
re.search(device_name_or_regex, device.name)):
if (include_all or device.name == device_name_or_regex or
device_name_or_regex == device.uuid or
(device_name_or_regex not in device.name and
re.search(device_name_or_regex, device.name))):
result.append(device)

return result
Expand Down
22 changes: 8 additions & 14 deletions riocli/jsonschema/schemas/deployment-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ definitions:
enum:
- device
- cloud
depends:
type: array
items:
"$ref": "#/definitions/deploymentDepends"
dependencies:
runtime:
oneOf:
Expand All @@ -135,6 +131,10 @@ definitions:
type: string
enum:
- device
depends:
type: array
items:
"$ref": "#/definitions/deploymentDepends"
device:
type: object
properties:
Expand All @@ -151,22 +151,18 @@ definitions:
type: array
items:
"$ref": "#/definitions/envArgsSpec"

volumes:
type: array
items:
"$ref": "#/definitions/deviceVolumeAttachSpec"

rosNetworks:
type: array
items:
"$ref": "#/definitions/deviceNetworkAttachSpec"

rosBagJobs:
type: array
items:
"$ref": "#/definitions/deviceROSBagJobSpec"

features:
type: object
properties:
Expand All @@ -191,7 +187,10 @@ definitions:
type: string
enum:
- cloud

depends:
type: array
items:
"$ref": "#/definitions/deploymentDepends"
features:
type: object
properties:
Expand Down Expand Up @@ -219,27 +218,22 @@ definitions:
type: array
items:
"$ref": "#/definitions/envArgsSpec"

volumes:
type: array
items:
"$ref": "#/definitions/cloudVolumeAttachSpec"

staticRoutes:
type: array
items:
"$ref": "#/definitions/endpointSpec"

rosNetworks:
type: array
items:
"$ref": "#/definitions/cloudNetworkAttachSpec"

managedServices:
type: array
items:
"$ref": "#/definitions/managedServiceSpec"

rosBagJobs:
type: array
items:
Expand Down
5 changes: 4 additions & 1 deletion riocli/package/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def fetch_packages(
if 'io-public' in pkg.packageId:
continue

if include_all or re.search(package_name_or_regex, pkg.packageName):
if (include_all or package_name_or_regex == pkg.packageName or
pkg.packageId == package_name_or_regex or
(package_name_or_regex not in pkg.packageName and
re.search(package_name_or_regex, pkg.packageName))):
result.append(pkg)

return result
Expand Down

0 comments on commit e59e50f

Please sign in to comment.