Fix: instance create crn is none when when giving --crn-hash or --crn… #417
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.
In aleph instance create:
aleph-client/src/aleph_client/commands/instance/__init__.py
Line 542 in f61e497
This comparaison is wrong since
crnis only used when finding a specific crn on the crn list:and crn_info is set
aleph-client/src/aleph_client/commands/instance/__init__.py
Line 500 in f61e497
So we should only ensure crn_info is set but not crn, since if we select a crn using the UI crn_url and crn_hash is None and crn is then None
Changes
This pull request makes small adjustments to the logic for determining pricing entities and requirements when creating an instance in
src/aleph_client/commands/instance/__init__.py. The changes simplify conditional checks and improve code clarity.Pricing entity selection:
PricingEntitybased on GPU and premium options has been refactored for improved readability.Requirements initialization:
crn_infoinstead of bothcrnandcrn_info, streamlining the condition.How to test
create a payg or credit or confidential instance