fix: skip unavailable optional appliances and add user_inputs_values fallback #PROESP-2753 - #29
Open
raulluzon wants to merge 18 commits into
Open
fix: skip unavailable optional appliances and add user_inputs_values fallback #PROESP-2753#29raulluzon wants to merge 18 commits into
raulluzon wants to merge 18 commits into
Conversation
…fallback Technitium DNS and route-manager-api are not present in the UMA OpenNebula marketplace so the installer was failing trying to fetch them. Bypass the marketplace lookup for both appliances and hard-code them as skipped. In oneflow_custom_attr_value_by_id, add a fallback to user_inputs_values (with case-insensitive key lookup) so the existing-service flow works under OpenNebula 7 where custom_attrs_values may be empty and values land in user_inputs_values instead. In onemarketapp_instantiate, remove onetemplate_chown, oneimage_chown, oneflow_template_chown, and the image/template enumeration from the existing-service path. Only oneflow_chown_by_id is needed and the removed calls were causing ownership failures on service instance IDs. Validated during the UMA deployment session (TN lmql, Jenkins build #5). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove onevm_user_input_by_id import from installer.py (unused after the route-manager-api marketplace call was removed) and remove the dead template/image enumeration loop in onemarketapp_instantiate VM path (unreachable after onetemplate_chown and oneimage_chown were removed). Fixes ruff F401 and F841 CI failures on PR #29. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the user answers yes to "Do you have the appliance instantiated?", the code correctly chowns the existing service but then unconditionally calls onemarketapp_add before setting is_instantiated=True. This causes an export attempt that fails with "NAME is already taken" when the toolkit service template was previously exported. The call serves no purpose in this path and must only exist in the else branch (new installation). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…M create endpoint TNLCM reqparse defines choices=["True", "False"]; sending lowercase "true" caused BadRequest which was wrapped as 500. Also removed the explicit Content-Type header that overrides curl's auto-generated multipart boundary, and added the required deployment_site_token field (validate=True requires all three: sites_branch, deployment_site, deployment_site_token). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ce attribute The endpoint was hardcoded as https:// regardless of whether MinIO TLS is enabled in the toolkit service. Read ONEAPP_MINIO_TLS_ENABLED via oneflow_custom_attr_value_by_id and use http:// when TLS is disabled (NO, FALSE, 0) and https:// otherwise. Also add TOOLKIT_SERVICE_MINIO_TLS_ENABLED to .env so the attribute key name is configurable alongside the other toolkit service keys. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
LGTM |
rmacian
approved these changes
Jun 22, 2026
…on missing env var Add TOOLKIT_SERVICE_MINIO_TLS_ENABLED to .env so users upgrading from pre-bca8609 deployments have the required variable. Also make get_dotenv_var raise SystemExit explicitly after logging the error so static analysis can confirm the function never returns None. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sions Appliances released before the TLS attribute was added (e.g. 20250915-1622-v1.0.0) do not expose ONEAPP_MINIO_TLS_ENABLED in custom_attrs_values or user_inputs_values. Add optional=True support to oneflow_custom_attr_value_by_id so the caller receives None instead of a hard abort; the existing http/https derivation already handles None by defaulting to http. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The MinIO appliance script defaults ONEAPP_MINIO_TLS_ENABLED to YES, so an older appliance without the attribute in its service template still runs MinIO over HTTPS. Writing http:// to core.yaml caused the Ansible s3_bucket/s3_object tasks to send plaintext HTTP to an HTTPS endpoint, producing a 400 Bad Request with empty headers. Flip the conditional so None (attribute absent) maps to https, matching the appliance script default. Only an explicit NO/FALSE/0 maps to http. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The toolkit installer now creates the trial-networks bucket in MinIO immediately after the endpoint is established, so users never have to create it manually before deploying Trial Networks. Introduces utils/s3.py with s3_ensure_bucket (boto3, path-style, verify=False for self-signed certs). MinIO root credentials are read from the OneFlow service custom attributes via two new .env keys: TOOLKIT_SERVICE_MINIO_ROOT_USER and TOOLKIT_SERVICE_MINIO_ROOT_PASSWORD. Adds boto3 to the project dependencies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolves ruff I001 violations: reorders utils.questionary before utils.s3 in installer.py, and boto3 before urllib3 in utils/s3.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Handle renamed custom_attrs -> user_inputs in OneFlow service templates - Handle renamed vm_template -> template_id in role definitions - Resolve appliance and datastore to numeric IDs in onemarketapp export to avoid Ruby nil error - Guard against missing IMAGE/VMTEMPLATE sections in export output - Skip re-export when matching service template already exists in OneFlow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
oneusername() calls sys.exit(1) when the user ID does not exist in OpenNebula (e.g. a deleted user still listed as group admin). Replace it with oneuser_show() in check_group_admin, which returns None for missing users, so stale references are skipped instead of crashing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OpenNebula returns USER_POOL["USER"] as a plain dict when there is exactly one user, instead of a list of dicts. Iterating over a dict yields string keys, causing "NAME key not found in user". Wrap the dict in a list before iteration, consistent with the same pattern already applied to HOST_POOL at line 1748. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OpenNebula XML-to-JSON converts a pool with one item to a plain dict instead of a list. Iterating over a dict yields string keys, triggering "NAME key not found" errors. Wrap GROUP, IMAGE, MARKETPLACE, VMTEMPLATE, VM, and VNET pools in a list when they are a dict, consistent with the existing HOST_POOL normalization at line 1748. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Refactor ask_select function to simplify parameters and improve compatibility.
Added a new function 'ask_select' to prompt user for a choice from a list, with optional default and validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
installer.py: Bypass the marketplace lookup for Technitium DNS and route-manager-api. Both appliances are absent from the UMA OpenNebula marketplace (6G Sandbox PRODUCTION), so the previousonemarketapp_instantiatecalls were failing. They are now hardcoded toFalse/Nonewith a warning log, preserving all downstream conditional logic that already handles the not-instantiated case.utils/one.py—oneflow_custom_attr_value_by_id: Add a fallback fromcustom_attrs_valuestouser_inputs_values(with case-insensitive key lookup). Under OpenNebula 7, OneFlow services store their input values inuser_inputs_valuesrather thancustom_attrs_values, causing the existing-service flow to fail when reading toolkit secrets.utils/one.py—onemarketapp_instantiate: Removeonetemplate_chown,oneimage_chown,oneflow_template_chown, and the associated image/template enumeration from the existing-service path. Onlyoneflow_chown_by_idis required; the removed calls were hitting ownership errors on service instance IDs that do not correspond to template IDs.Validation
Patches were applied and validated on the UMA OpenNebula frontend (
/opt/toolkit-installer/) during a live debugging session:lmqlreachedactivatedstate.TN_DEPLOY_lmqlbuild Assigning downloaded appliances to the jenkins OpenNebula username #5 succeeded end-to-end with Open5GS deployed asopen5gs_k8s-core.Test plan
oneflow_custom_attr_value_by_id.🤖 Generated with Claude Code