mirror of
https://github.com/gryf/boxpy.git
synced 2026-03-25 23:03:33 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a75739cee1 | |||
| cd1dc310c7 | |||
| 295fb59101 | |||
| 60e45b9bfc | |||
| 88172acd67 | |||
| 4c3aef3a85 | |||
| 189fbab17d |
@@ -37,20 +37,23 @@ Tested distros
|
|||||||
- 20.04
|
- 20.04
|
||||||
- 22.04
|
- 22.04
|
||||||
- 24.04
|
- 24.04
|
||||||
|
- 25.04
|
||||||
- Fedora
|
- Fedora
|
||||||
- 37
|
- 37
|
||||||
- 38
|
- 38
|
||||||
- 39
|
- 39
|
||||||
- 40
|
- 40
|
||||||
- 41
|
- 41
|
||||||
|
- 42
|
||||||
- Centos Stream
|
- Centos Stream
|
||||||
- 8
|
- 8
|
||||||
- 9
|
- 9
|
||||||
|
- 10
|
||||||
- Debian
|
- Debian
|
||||||
- 10 (buster)
|
- 10 (buster)
|
||||||
- 11 (bullseye)
|
- 11 (bullseye)
|
||||||
- 12 (bookworm)
|
- 12 (bookworm)
|
||||||
- 13 (trixie) - prerelease
|
- 13 (trixie)
|
||||||
|
|
||||||
There is possibility to use whatever OS image which supports cloud-init. Use
|
There is possibility to use whatever OS image which supports cloud-init. Use
|
||||||
the ``--image`` param for ``create`` command to pass image filename, although
|
the ``--image`` param for ``create`` command to pass image filename, although
|
||||||
@@ -76,7 +79,7 @@ You'll have ``boxpy`` command created for you as well.
|
|||||||
.. code:: shell-session
|
.. code:: shell-session
|
||||||
|
|
||||||
$ boxpy -V
|
$ boxpy -V
|
||||||
boxpy 1.9.2
|
boxpy 1.11.3
|
||||||
|
|
||||||
Other option is simply link it somewhere in the path:
|
Other option is simply link it somewhere in the path:
|
||||||
|
|
||||||
|
|||||||
20
box.py
20
box.py
@@ -18,7 +18,7 @@ import requests
|
|||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
__version__ = "1.11.0"
|
__version__ = "1.11.3"
|
||||||
|
|
||||||
CACHE_DIR = os.environ.get('XDG_CACHE_HOME', os.path.expanduser('~/.cache'))
|
CACHE_DIR = os.environ.get('XDG_CACHE_HOME', os.path.expanduser('~/.cache'))
|
||||||
CLOUD_IMAGE = "ci.iso"
|
CLOUD_IMAGE = "ci.iso"
|
||||||
@@ -275,8 +275,9 @@ class Run:
|
|||||||
Helper class on subprocess.run()
|
Helper class on subprocess.run()
|
||||||
command is a list with command and its params to execute
|
command is a list with command and its params to execute
|
||||||
"""
|
"""
|
||||||
def __init__(self, command):
|
def __init__(self, command, capture=True):
|
||||||
result = subprocess.run(command, encoding='utf-8', capture_output=True)
|
result = subprocess.run(command, encoding='utf-8',
|
||||||
|
capture_output=capture)
|
||||||
|
|
||||||
self.returncode = result.returncode
|
self.returncode = result.returncode
|
||||||
self.stdout = result.stdout.strip() if result.stdout else ''
|
self.stdout = result.stdout.strip() if result.stdout else ''
|
||||||
@@ -1143,7 +1144,9 @@ class Fedora(Image):
|
|||||||
'38': '1.6',
|
'38': '1.6',
|
||||||
'39': '1.5',
|
'39': '1.5',
|
||||||
'40': '1.14',
|
'40': '1.14',
|
||||||
'41': '1.4'}
|
'41': '1.4',
|
||||||
|
'42': '1.1',
|
||||||
|
'43': '1.6'}
|
||||||
|
|
||||||
def __init__(self, vbox, version, arch, fname=None):
|
def __init__(self, vbox, version, arch, fname=None):
|
||||||
super().__init__(vbox, version, arch)
|
super().__init__(vbox, version, arch)
|
||||||
@@ -1250,12 +1253,12 @@ DISTROS = {'ubuntu': {'username': 'ubuntu',
|
|||||||
'realname': 'centos',
|
'realname': 'centos',
|
||||||
'img_class': CentosStream,
|
'img_class': CentosStream,
|
||||||
'amd64': 'x86_64',
|
'amd64': 'x86_64',
|
||||||
'default_version': '9'},
|
'default_version': '10'},
|
||||||
'debian': {'username': 'debian',
|
'debian': {'username': 'debian',
|
||||||
'realname': 'debian',
|
'realname': 'debian',
|
||||||
'img_class': Debian,
|
'img_class': Debian,
|
||||||
'amd64': 'amd64',
|
'amd64': 'amd64',
|
||||||
'default_version': '12'}}
|
'default_version': '13'}}
|
||||||
|
|
||||||
|
|
||||||
def get_image_object(vbox, version, image='ubuntu', arch='amd64'):
|
def get_image_object(vbox, version, image='ubuntu', arch='amd64'):
|
||||||
@@ -1635,7 +1638,7 @@ def connect(args):
|
|||||||
f'@localhost:{conf.port}']
|
f'@localhost:{conf.port}']
|
||||||
LOG.debug('Connecting to vm `%s` using command:\n%s', args.name,
|
LOG.debug('Connecting to vm `%s` using command:\n%s', args.name,
|
||||||
' '.join(cmd))
|
' '.join(cmd))
|
||||||
return Run(cmd, False).returncode
|
return Run(cmd, capture=False).returncode
|
||||||
|
|
||||||
|
|
||||||
def _set_vmstate(name, state, guitype=None, poweroff=False):
|
def _set_vmstate(name, state, guitype=None, poweroff=False):
|
||||||
@@ -1824,4 +1827,7 @@ def main():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
try:
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
sys.exit(50)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools >= 61.0"]
|
requires = ["setuptools >= 77.0"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
@@ -8,7 +8,7 @@ dynamic = ["version"]
|
|||||||
authors = [
|
authors = [
|
||||||
{name = "Roman Dobosz", email = "gryf73@gmail.com"}
|
{name = "Roman Dobosz", email = "gryf73@gmail.com"}
|
||||||
]
|
]
|
||||||
license = {text = "GPLv3"}
|
license = "GPL-3.0-or-later"
|
||||||
description = "Run Linux cloud image on top of VirtualBox using commandline tool"
|
description = "Run Linux cloud image on top of VirtualBox using commandline tool"
|
||||||
readme = "README.rst"
|
readme = "README.rst"
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
@@ -18,7 +18,6 @@ classifiers = [
|
|||||||
"Intended Audience :: End Users/Desktop",
|
"Intended Audience :: End Users/Desktop",
|
||||||
"Topic :: Terminals",
|
"Topic :: Terminals",
|
||||||
"Topic :: Utilities",
|
"Topic :: Utilities",
|
||||||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
@@ -44,9 +43,6 @@ py-modules = ["box"]
|
|||||||
[tool.setuptools.dynamic]
|
[tool.setuptools.dynamic]
|
||||||
version = {attr = "box.__version__"}
|
version = {attr = "box.__version__"}
|
||||||
|
|
||||||
[tool.distutils.bdist_wheel]
|
|
||||||
universal = true
|
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 79
|
line-length = 79
|
||||||
indent-width = 4
|
indent-width = 4
|
||||||
|
|||||||
Reference in New Issue
Block a user