mirror of
https://github.com/gryf/boxpy.git
synced 2025-12-18 21:10:17 +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:
|
||||
ATTRS = ('cpus', 'config', 'disk_size', 'distro', 'hostname', 'key',
|
||||
'memory', 'name', 'port', 'version')
|
||||
ATTRS = ('cpus', 'config', 'creator', 'disk_size', 'distro', 'hostname',
|
||||
'key', 'memory', 'name', 'port', 'version')
|
||||
|
||||
def __init__(self, args, vbox=None):
|
||||
self.advanced = None
|
||||
self.distro = None
|
||||
self.cpus = None
|
||||
self.creator = None
|
||||
self.disk_size = None
|
||||
self.hostname = None
|
||||
self.key = None
|
||||
@@ -1032,6 +1033,9 @@ def vmcreate(args, conf=None):
|
||||
if not vbox.setextradata('user_data', conf.user_data):
|
||||
return 6
|
||||
|
||||
if not vbox.setextradata('creator', 'boxpy'):
|
||||
return 13
|
||||
|
||||
image = get_image_object(vbox, conf.version, image=conf.distro)
|
||||
path_to_disk = image.convert_to_vdi(conf.name + '.vdi', conf.disk_size)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user