Closed adl2db closed 5 years ago
What is the issue? I don't see it. The return is a list as you suggested.
Do you mean you expect a return of one instance and not a list?
@adl2db this is expected behavior - if you look here the general "instances" command will return a list given that there are more than one instances found. It only returns a single instance given that one instance is found:
# If we are given a name, return just one
if name is not None and instances is not None:
if len(instances) == 1:
instances = instances[0]
Given that you provided a name, it could be that the statement needs to be:
# If we are given a name, return just one
if name != None and instances != None:
if len(instances) == 1:
instances = instances[0]
I can either reproduce this for you if you provide the full sequence of creating the instances, or I can do a PR that tests that change. It looks like the bug is that if name is provided, the list of instances isn't actually filtered down.
hey @adl2db ! I understand your issue - and agreed, if you provide a name a single instance should be returned! Here is a pull request for you to test -> https://github.com/singularityhub/singularity-cli/pull/84 could you let me know if it resolves your issue?
Expected Behavior
using client.instances('name_of_instance') should return an Instance object
Following Sample from Documentation
Actual Behavior
using client.instances('name_of_instance') should returns list of instances
Steps to Reproduce
Context
[provide more detailed introduction to the issue itself . This is for make a reproducible issue.]