Skip to content

Commit e294566

Browse files
author
Todd DeLuca
committed
Merge branch 'eighthave-master'
2 parents 6366f8a + ce2adf1 commit e294566

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

vagrant/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,23 @@ def box_list(self):
666666
output = self._run_vagrant_command(['box', 'list', '--machine-readable'])
667667
return self._parse_box_list(output)
668668

669+
def package(self, vm_name=None, base=None, output=None, vagrantfile=None):
670+
'''
671+
Packages a running vagrant environment into a box.
672+
673+
vm_name=None: name of VM.
674+
base=None: name of a VM in virtualbox to package as a base box
675+
output=None: name of the file to output
676+
vagrantfile=None: Vagrantfile to package with this box
677+
'''
678+
cmd = ['package', vm_name]
679+
if output is not None:
680+
cmd += ['--output', output]
681+
if vagrantfile is not None:
682+
cmd += ['--vagrantfile', vagrantfile]
683+
684+
self._call_vagrant_command(cmd)
685+
669686
def snapshot_push(self):
670687
'''
671688
This takes a snapshot and pushes it onto the snapshot stack.

0 commit comments

Comments
 (0)