Skip to content

Commit

Permalink
Revert "add builder/hyperv-vmcx (#94)"
Browse files Browse the repository at this point in the history
This reverts commit e3e5d11.
  • Loading branch information
mayn committed Mar 15, 2018
1 parent e3e5d11 commit b29fab3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 89 deletions.
1 change: 0 additions & 1 deletion README.rst
Expand Up @@ -103,7 +103,6 @@ Builders:
- file
- googlecompute
- hyperv-iso
- hyperv-vmcx
- lxc
- lxd
- null
Expand Down
61 changes: 1 addition & 60 deletions src/packerlicious/builder.py
Expand Up @@ -120,6 +120,7 @@ class Alicloud(PackerBuilder):
}



class AmazonSourceAmiFilter(PackerProperty):
"""
https://www.packer.io/docs/builders/amazon-ebs.html#source_ami_filter
Expand Down Expand Up @@ -800,64 +801,6 @@ class HyperV(PackerBuilder):
}


class HyperVvmcx(PackerBuilder):
"""
Hyper-V Builder (from a vmcx)
https://www.packer.io/docs/builders/hyperv-vmcx.html
"""
resource_type = "hyperv-vmcx"

props = {
'clone_from_vmxc_path': (str, False),
'clone_from_vm_name': (str, False),
'clone_from_snapshot_name': (str, False),
'clone_all_snapshots': (validator.boolean, False),
'boot_command': ([str], False),
'boot_wait': (str, False),
'cpu': (int, False),
'enable_dynamic_memory': (validator.boolean, False),
'enable_mac_spoofing': (validator.boolean, False),
'enable_secure_boot': (validator.boolean, False),
'enable_virtualization_extensions': (validator.boolean, False),
'floppy_files': ([str], False),
'floppy_dirs': ([str], False),
'guest_additions_mode': (str, False),
'guest_additions_path': (str, False),
'http_directory': (str, False),
'http_port_min': (int, False),
'http_port_max': (int, False),
'iso_checksum': (str, False),
'iso_checksum_type': (str, False),
'iso_url': (str, False),
'iso_urls': ([str], False),
'iso_target_extension': (str, False),
'iso_target_path': (str, False),
'output_directory': (str, False),
'ram_size': (int, False),
'secondary_iso_images': ([str], False),
'shutdown_command': (str, False),
'shutdown_timeout': (str, False),
'skip_compaction': (validator.boolean, False),
'switch_name': (str, False),
'switch_vlan_id': (str, False),
'vlan_id': (str, False),
'vm_name': (str, False),
}

def validate(self):
conds = [
'clone_from_vmxc_path',
'clone_from_vm_name'
]
validator.exactly_one(self.__class__.__name__, self.properties, conds)

iso_url_conds = [
'iso_url',
'iso_urls'
]
validator.mutually_exclusive(self.__class__.__name__, self.properties, iso_url_conds)


class LXD(PackerBuilder):
"""
LXD Builder
Expand All @@ -872,7 +815,6 @@ class LXD(PackerBuilder):
'command_wrapper': (str, False),
}


class LXC(PackerBuilder):
"""
LXC Builder
Expand All @@ -892,7 +834,6 @@ class LXC(PackerBuilder):
'template_parameters': ([str], False),
}


class Null(PackerBuilder):
"""
Null Builder
Expand Down
28 changes: 0 additions & 28 deletions tests/packerlicious/test_builder_hyperv.py
Expand Up @@ -11,31 +11,3 @@ def test_required_fields_missing(self):
with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'required' in str(excinfo.value)


class TestHyperVvmcxBuilder(object):

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

with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'HyperVvmcx: one of the following must be specified: clone_from_vmxc_path, clone_from_vm_name' == str(excinfo.value)

def test_exactly_one_clone_from_required(self):
b = builder.HyperVvmcx(
clone_from_vmxc_path="c:\\virtual machines\\ubuntu-12.04.5-server-amd64",
clone_from_vm_name="ubuntu-12.04.5-server-amd64"
)

with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'HyperVvmcx: only one of the following can be specified: clone_from_vmxc_path, clone_from_vm_name' == str(
excinfo.value)

def test_exactly_one_clone_from_specified(self):
b = builder.HyperVvmcx(
clone_from_vmxc_path="c:\\virtual machines\\ubuntu-12.04.5-server-amd64",
)

b.to_dict()

0 comments on commit b29fab3

Please sign in to comment.