Skip to content

Commit

Permalink
Merge 1353257 into c8cce9a
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejkw authored Oct 10, 2017
2 parents c8cce9a + 1353257 commit 75aec9c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/packerlicious/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,24 @@ class LXD(PackerBuilder):
'command_wrapper': (basestring, False),
}

class LXC(PackerBuilder):
"""
LXC Builder
https://www.packer.io/docs/builders/lxc.html
"""
resource_type = "lxc"

props = {
'config_file': (str, True),
'template_name': (str, True),
'template_environment_vars': ([str], True),
'target_runlevel': (int, False),
'output_directory': (str, False),
'container_name': (str, False),
'command_wrapper': (str, False),
'init_timeout': (str, False),
'template_parameters': ([str], False),
}

class Null(PackerBuilder):
"""
Expand Down
13 changes: 13 additions & 0 deletions tests/packerlicious/test_builder_lxc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest

import packerlicious.builder as builder


class TestLxcBuilder(object):

def test_required_fields_missing(self):
b = builder.LXC()

with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'required' in str(excinfo.value)

0 comments on commit 75aec9c

Please sign in to comment.