Skip to content

Commit

Permalink
Merge pull request #76 from rapyuta-robotics/devel
Browse files Browse the repository at this point in the history
🎉 release: v1.15.0
  • Loading branch information
pallabpain authored Feb 27, 2024
2 parents 65378a0 + d2ee458 commit 54f589d
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions rapyuta_io/clients/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,29 +875,50 @@ class ExecutableMount(object):
:vartype mount_path: str
:ivar sub_path: Subpath of the executable
:vartype sub_path: str
:ivar uid: Userid to which subpath belongs to
:vartype uid: int
:ivar gid: Groupid to which subpath belongs to
:vartype gid: int
:ivar perm: Permissions for subpath
:vartype perm: int
:param exec_name: Name of the executable.
:type exec_name: str
:param mount_path: Mountpath of the executable
:type mount_path: str
:param sub_path: Subpath of the executable
:type sub_path: str
:param uid: userid of subpath
:type uid: int
:param gid: groupid of subpath
:type gid: int
:param perm: permissions of subpath
:type perm: int
"""

def __init__(self, exec_name, mount_path, sub_path=None):
self.validate(exec_name, mount_path, sub_path)
def __init__(self, exec_name, mount_path, sub_path=None, uid=None, gid=None, perm=None):
self.validate(exec_name, mount_path, sub_path, uid, gid, perm)
self.exec_name = exec_name
self.mount_path = mount_path
self.sub_path = sub_path
self.uid = uid
self.gid = gid
self.perm = perm

@staticmethod
def validate(exec_name, mount_path, sub_path=None):
def validate(exec_name, mount_path, sub_path=None, uid=None, gid=None, perm=None):
if not isinstance(exec_name, six.string_types):
raise InvalidParameterException('exec_name must be a non-empty string')
if not isinstance(mount_path, six.string_types):
raise InvalidParameterException('mount_path must be a non-empty string')
if sub_path is not None and not isinstance(sub_path, six.string_types):
raise InvalidParameterException('sub_path must be a non-empty string')
if uid is not None and not isinstance(uid, six.integer_types):
raise InvalidParameterException('uid must be a non-empty integer')
if gid is not None and not isinstance(gid, six.integer_types):
raise InvalidParameterException('gid must be a non-empty integer')
if perm is not None and not isinstance(perm, six.integer_types):
raise InvalidParameterException('perm must be a non-empty integer')


class RestartPolicy(str, enum.Enum):
Expand Down

0 comments on commit 54f589d

Please sign in to comment.