mirror of
https://github.com/gryf/boxpy.git
synced 2025-12-20 14:17:57 +01:00
Adding extra data 'creator'.
This field would help to distinguish if VM has been created by boxpy, or manually.
This commit is contained in:
8
box.py
8
box.py
@@ -330,13 +330,14 @@ class FakeLogger:
|
|||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
ATTRS = ('cpus', 'config', 'disk_size', 'distro', 'hostname', 'key',
|
ATTRS = ('cpus', 'config', 'creator', 'disk_size', 'distro', 'hostname',
|
||||||
'memory', 'name', 'port', 'version')
|
'key', 'memory', 'name', 'port', 'version')
|
||||||
|
|
||||||
def __init__(self, args, vbox=None):
|
def __init__(self, args, vbox=None):
|
||||||
self.advanced = None
|
self.advanced = None
|
||||||
self.distro = None
|
self.distro = None
|
||||||
self.cpus = None
|
self.cpus = None
|
||||||
|
self.creator = None
|
||||||
self.disk_size = None
|
self.disk_size = None
|
||||||
self.hostname = None
|
self.hostname = None
|
||||||
self.key = None
|
self.key = None
|
||||||
@@ -1032,6 +1033,9 @@ def vmcreate(args, conf=None):
|
|||||||
if not vbox.setextradata('user_data', conf.user_data):
|
if not vbox.setextradata('user_data', conf.user_data):
|
||||||
return 6
|
return 6
|
||||||
|
|
||||||
|
if not vbox.setextradata('creator', 'boxpy'):
|
||||||
|
return 13
|
||||||
|
|
||||||
image = get_image_object(vbox, conf.version, image=conf.distro)
|
image = get_image_object(vbox, conf.version, image=conf.distro)
|
||||||
path_to_disk = image.convert_to_vdi(conf.name + '.vdi', conf.disk_size)
|
path_to_disk = image.convert_to_vdi(conf.name + '.vdi', conf.disk_size)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user