Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing Attributes in Termination Script #53

Open
mattronix opened this issue Feb 14, 2024 · 2 comments
Open

Accessing Attributes in Termination Script #53

mattronix opened this issue Feb 14, 2024 · 2 comments

Comments

@mattronix
Copy link

When creating a resource with a script i use (python):

attributes = json.loads(os.environ.get("ATTRIBUTES"))

To access the attributes of a resource.

However in a termination script i cant use the same method it seems to access the attributes as it gives me the following error:

2024-02-14T13:53:32.944140165Z [2024-02-14 13:53:32,943: ERROR/ForkPoolWorker-9] Error processing order type: Terminate, offering: Storage Share fs.ti, created_by: 089353b4-782e-44ba-a88a-382920d816e8 (Matthew Frost). Order ID: 129. Exception: [ErrorDetail(string='Command '['python', 'script']' in image 'mattronix:alpine-py-3.11' returned non-zero exit status 1: b'Traceback (most recent call last):\n File "/work/script", line 117, in \n new_user = attributes["username"]\n

When i do a print its also not set it seems, however i do see them in the database.

(once im finished with these scripts il send them your way also for the examples)

@mattronix
Copy link
Author

mattronix commented Feb 14, 2024

In case its useful im publishing my work here: https://github.com/mattronix/waldur-custom-offerings/blob/main/create_user_over_ssh/storage-user-add-waldur.py

its a script for a very basic add user + samba share.

@mattronix
Copy link
Author

did you get a chance to look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant