Skip to content

Commit 3ac8045

Browse files
authored
Merge pull request #179 from singularityhub/allow-options-set-for-instance-on-init
Ensuring options and args are used if set from instance init
2 parents b746a81 + ac34617 commit 3ac8045

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
1717
singularity on pypi), and the versions here will coincide with these releases.
1818

1919
## [master](https://github.com/singularityhub/singularity-cli/tree/master)
20+
- ensure options and args from instance init are honored (0.0.15)
2021
- choose output for stream_command (0.0.14)
2122
- adding support to pull from a url (0.1.13)
2223
- add more verbosity to instance start/stop (0.1.12)

spython/instance/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def __init__(self, image, start=True, name=None, quiet=True, **kwargs):
2828

2929
# Update metadats from arguments
3030
self._update_metadata(kwargs)
31-
self.options = []
31+
self.options = kwargs.get("options", [])
32+
self.args = kwargs.get("args", [])
3233
self.cmd = []
3334
self.quiet = quiet
3435

spython/instance/cmd/start.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ def start(
6363

6464
cmd = self._init_command(subgroup, singularity_options)
6565

66+
# Set options and args
67+
args = args or self.args
68+
options = options or self.options
69+
6670
# Add options, if they are provided
6771
if not isinstance(options, list):
6872
options = [] if options is None else options.split(" ")

spython/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

77

8-
__version__ = "0.1.14"
8+
__version__ = "0.1.15"
99
AUTHOR = "Vanessa Sochat"
1010
AUTHOR_EMAIL = "[email protected]"
1111
NAME = "spython"

0 commit comments

Comments
 (0)