Skip to content

Commit

Permalink
Merge pull request #373 from balena-io/fix-docs-2
Browse files Browse the repository at this point in the history
Fix docs for device.config_var.set
  • Loading branch information
flowzone-app[bot] authored Oct 25, 2024
2 parents 81011bb + 4c42649 commit 88e96aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2244,15 +2244,15 @@ Remove a device environment variable.
### Function: set(uuid_or_id, env_var_name, value) ⇒ <code>None</code>

Set the value of a device config variable.

Note that config variables must start with BALENA_ and RESIN_ prefixes.
#### Args:
uuid_or_id (Union[str, int]): device uuid (string) or id (int)
env_var_name (str): environment variable name.
value (str): environment variable value.

#### Examples:
```python
>>> balena.models.device.config_var.device.set('8deb12','test_env4', 'testing1')
>>> balena.models.device.config_var.set('8deb12','BALENA_test_env4', 'testing1')
```
## DeviceEnvVariable

Expand Down
2 changes: 1 addition & 1 deletion balena/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def __init__(self, body, status_code=None):
self.message = Message.REQUEST_ERROR.format(body=body)
self.body = body
self.status_code = status_code
# print(self.message, status_code)
print(self.message, status_code)


class NotLoggedIn(BalenaException):
Expand Down
4 changes: 2 additions & 2 deletions balena/models/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -2145,14 +2145,14 @@ def get(self, uuid_or_id: Union[str, int], env_var_name: str) -> Optional[str]:
def set(self, uuid_or_id: Union[str, int], env_var_name: str, value: str) -> None:
"""
Set the value of a device config variable.
Note that config variables must start with BALENA_ and RESIN_ prefixes.
Args:
uuid_or_id (Union[str, int]): device uuid (string) or id (int)
env_var_name (str): environment variable name.
value (str): environment variable value.
Examples:
>>> balena.models.device.config_var.device.set('8deb12','test_env4', 'testing1')
>>> balena.models.device.config_var.set('8deb12','BALENA_test_env4', 'testing1')
"""
super(DeviceConfigVariable, self)._set(uuid_or_id, env_var_name, value)

Expand Down

0 comments on commit 88e96aa

Please sign in to comment.