Merge lp:~allenap/maas/rename-to-maascluster into lp:~maas-committers/maas/trunk
- rename-to-maascluster
- Merge into trunk
Proposed by
Gavin Panella
Status: | Rejected |
---|---|
Rejected by: | MAAS Lander |
Proposed branch: | lp:~allenap/maas/rename-to-maascluster |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
10593 lines (+1870/-1908) 344 files modified
MANIFEST.in (+2/-2) buildout.cfg (+4/-4) docs/development/rpc.rst (+8/-8) docs/development/tagging.rst (+6/-6) etc/maas/templates/power/apc.template (+2/-2) etc/maas/templates/power/esxi.template (+2/-2) etc/maas/templates/power/mscm.template (+2/-2) etc/maas/templates/power/msftocs.template (+2/-2) etc/maas/templates/power/sm15k.template (+3/-3) etc/maas/templates/power/ucsm.template (+2/-2) etc/maas/templates/power/virsh.template (+2/-2) etc/maas/templates/power/vsphere.template (+2/-2) scripts/ampclient.py (+3/-3) scripts/maas-import-pxe-files (+1/-1) scripts/uec2roottar (+1/-1) services/dns/run (+2/-2) src/maas/customise_test_db.py (+1/-1) src/maas/development.py (+3/-3) src/maas/settings.py (+3/-3) src/maascluster/__main__.py (+15/-15) src/maascluster/auth.py (+1/-1) src/maascluster/boot/__init__.py (+10/-10) src/maascluster/boot/install_bootloader.py (+1/-1) src/maascluster/boot/install_grub.py (+3/-3) src/maascluster/boot/powerkvm.py (+4/-4) src/maascluster/boot/powernv.py (+3/-3) src/maascluster/boot/pxe.py (+3/-3) src/maascluster/boot/tests/test_boot.py (+9/-9) src/maascluster/boot/tests/test_install_bootloader.py (+4/-4) src/maascluster/boot/tests/test_install_grub.py (+5/-5) src/maascluster/boot/tests/test_powerkvm.py (+8/-8) src/maascluster/boot/tests/test_powernv.py (+14/-14) src/maascluster/boot/tests/test_pxe.py (+13/-13) src/maascluster/boot/tests/test_tftppath.py (+14/-16) src/maascluster/boot/tests/test_uefi.py (+13/-13) src/maascluster/boot/tests/test_utils.py (+3/-3) src/maascluster/boot/tests/test_windows.py (+19/-19) src/maascluster/boot/tftppath.py (+6/-8) src/maascluster/boot/uefi.py (+7/-7) src/maascluster/boot/utils.py (+2/-2) src/maascluster/boot/windows.py (+9/-9) src/maascluster/cluster_config.py (+1/-1) src/maascluster/cluster_config_command.py (+2/-2) src/maascluster/config.py (+5/-5) src/maascluster/configure_maas_url.py (+2/-2) src/maascluster/customize_config.py (+1/-1) src/maascluster/dhcp/config.py (+2/-2) src/maascluster/dhcp/control.py (+2/-2) src/maascluster/dhcp/detect.py (+1/-1) src/maascluster/dhcp/leases.py (+3/-3) src/maascluster/dhcp/leases_parser_fast.py (+1/-1) src/maascluster/dhcp/omshell.py (+3/-3) src/maascluster/dhcp/probe.py (+1/-1) src/maascluster/dhcp/tests/test_config.py (+4/-4) src/maascluster/dhcp/tests/test_control.py (+10/-10) src/maascluster/dhcp/tests/test_detect.py (+7/-7) src/maascluster/dhcp/tests/test_leases.py (+9/-9) src/maascluster/dhcp/tests/test_leases_parser.py (+5/-5) src/maascluster/dhcp/tests/test_omshell.py (+7/-7) src/maascluster/dhcp/tests/test_writer.py (+4/-4) src/maascluster/dhcp/writer.py (+1/-1) src/maascluster/diskless.py (+6/-6) src/maascluster/dns/actions.py (+3/-3) src/maascluster/dns/config.py (+3/-3) src/maascluster/dns/tests/test_actions.py (+13/-13) src/maascluster/dns/tests/test_config.py (+10/-10) src/maascluster/dns/tests/test_zoneconfig.py (+9/-9) src/maascluster/dns/zoneconfig.py (+10/-10) src/maascluster/drivers/__init__.py (+2/-2) src/maascluster/drivers/diskless/__init__.py (+2/-2) src/maascluster/drivers/diskless/tests/test_base.py (+7/-7) src/maascluster/drivers/hardware/esxi.py (+3/-3) src/maascluster/drivers/hardware/mscm.py (+5/-5) src/maascluster/drivers/hardware/msftocs.py (+2/-2) src/maascluster/drivers/hardware/seamicro.py (+4/-4) src/maascluster/drivers/hardware/tests/test_apc.py (+9/-9) src/maascluster/drivers/hardware/tests/test_esxi.py (+3/-3) src/maascluster/drivers/hardware/tests/test_mscm.py (+12/-12) src/maascluster/drivers/hardware/tests/test_msftocs.py (+11/-11) src/maascluster/drivers/hardware/tests/test_seamicro.py (+15/-15) src/maascluster/drivers/hardware/tests/test_ucsm.py (+19/-19) src/maascluster/drivers/hardware/tests/test_virsh.py (+3/-3) src/maascluster/drivers/hardware/tests/test_vsphere.py (+7/-7) src/maascluster/drivers/hardware/ucsm.py (+2/-2) src/maascluster/drivers/hardware/virsh.py (+3/-3) src/maascluster/drivers/hardware/vsphere.py (+3/-3) src/maascluster/drivers/osystem/__init__.py (+7/-7) src/maascluster/drivers/osystem/centos.py (+1/-1) src/maascluster/drivers/osystem/custom.py (+2/-2) src/maascluster/drivers/osystem/suse.py (+1/-1) src/maascluster/drivers/osystem/tests/test_base.py (+8/-8) src/maascluster/drivers/osystem/tests/test_centos.py (+3/-3) src/maascluster/drivers/osystem/tests/test_custom.py (+4/-4) src/maascluster/drivers/osystem/tests/test_debian_networking.py (+6/-6) src/maascluster/drivers/osystem/tests/test_suse.py (+3/-3) src/maascluster/drivers/osystem/tests/test_ubuntu.py (+8/-8) src/maascluster/drivers/osystem/tests/test_windows.py (+4/-4) src/maascluster/drivers/osystem/ubuntu.py (+4/-4) src/maascluster/drivers/osystem/windows.py (+2/-2) src/maascluster/drivers/power/__init__.py (+3/-3) src/maascluster/drivers/power/tests/test_base.py (+11/-11) src/maascluster/drivers/tests/test_base.py (+8/-8) src/maascluster/events.py (+5/-5) src/maascluster/import_images/boot_image_mapping.py (+2/-2) src/maascluster/import_images/boot_resources.py (+19/-21) src/maascluster/import_images/download_descriptions.py (+2/-4) src/maascluster/import_images/download_resources.py (+3/-3) src/maascluster/import_images/helpers.py (+1/-1) src/maascluster/import_images/keyrings.py (+1/-1) src/maascluster/import_images/testing/factory.py (+2/-4) src/maascluster/import_images/tests/test_boot_image_mapping.py (+4/-6) src/maascluster/import_images/tests/test_boot_resources.py (+10/-12) src/maascluster/import_images/tests/test_cleanup.py (+1/-1) src/maascluster/import_images/tests/test_download_descriptions.py (+7/-9) src/maascluster/import_images/tests/test_download_resources.py (+3/-3) src/maascluster/import_images/tests/test_helpers.py (+1/-1) src/maascluster/import_images/tests/test_keyrings.py (+1/-1) src/maascluster/import_images/tests/test_product_mapping.py (+5/-7) src/maascluster/import_images/tests/test_uec2roottar.py (+1/-1) src/maascluster/import_images/uec2roottar.py (+3/-3) src/maascluster/kernel_opts.py (+1/-1) src/maascluster/logger/__init__.py (+2/-2) src/maascluster/logger/tests/test_logger.py (+4/-4) src/maascluster/network.py (+1/-1) src/maascluster/path.py (+1/-1) src/maascluster/plugin.py (+18/-20) src/maascluster/power/poweraction.py (+2/-2) src/maascluster/power/tests/test_poweraction.py (+13/-13) src/maascluster/pserv_services/dhcp_probe_service.py (+5/-5) src/maascluster/pserv_services/image_download_service.py (+6/-6) src/maascluster/pserv_services/lease_upload_service.py (+5/-5) src/maascluster/pserv_services/node_power_monitor_service.py (+6/-6) src/maascluster/pserv_services/tests/test_dhcp_probe_service.py (+8/-10) src/maascluster/pserv_services/tests/test_image_download_service.py (+14/-14) src/maascluster/pserv_services/tests/test_lease_upload_service.py (+16/-16) src/maascluster/pserv_services/tests/test_node_power_monitor_service.py (+10/-12) src/maascluster/pserv_services/tests/test_tftp.py (+17/-17) src/maascluster/pserv_services/tftp.py (+9/-9) src/maascluster/rpc/__init__.py (+3/-3) src/maascluster/rpc/boot_images.py (+7/-7) src/maascluster/rpc/cluster.py (+4/-4) src/maascluster/rpc/clusterservice.py (+43/-49) src/maascluster/rpc/common.py (+2/-2) src/maascluster/rpc/dhcp.py (+9/-9) src/maascluster/rpc/monitors.py (+4/-4) src/maascluster/rpc/osystems.py (+2/-2) src/maascluster/rpc/power.py (+7/-7) src/maascluster/rpc/region.py (+3/-3) src/maascluster/rpc/service.py (+1/-1) src/maascluster/rpc/tags.py (+3/-3) src/maascluster/rpc/testing/__init__.py (+16/-16) src/maascluster/rpc/testing/doubles.py (+2/-2) src/maascluster/rpc/tests/test_arguments.py (+1/-1) src/maascluster/rpc/tests/test_boot_images.py (+17/-17) src/maascluster/rpc/tests/test_clusterservice.py (+37/-37) src/maascluster/rpc/tests/test_common.py (+3/-3) src/maascluster/rpc/tests/test_dhcp.py (+11/-11) src/maascluster/rpc/tests/test_docs.py (+6/-6) src/maascluster/rpc/tests/test_exceptions.py (+2/-2) src/maascluster/rpc/tests/test_module.py (+6/-6) src/maascluster/rpc/tests/test_monitors.py (+11/-11) src/maascluster/rpc/tests/test_osystems.py (+11/-11) src/maascluster/rpc/tests/test_power.py (+16/-16) src/maascluster/rpc/tests/test_service.py (+8/-8) src/maascluster/rpc/tests/test_tags.py (+2/-2) src/maascluster/security.py (+2/-2) src/maascluster/tags.py (+3/-3) src/maascluster/testing/bindfixture.py (+3/-3) src/maascluster/testing/config.py (+4/-4) src/maascluster/testing/os.py (+2/-2) src/maascluster/testing/tests/test_bindfixture.py (+2/-2) src/maascluster/tests/__init__.py (+1/-1) src/maascluster/tests/test_cluster_config.py (+4/-4) src/maascluster/tests/test_cluster_config_command.py (+8/-8) src/maascluster/tests/test_config.py (+16/-16) src/maascluster/tests/test_configure_maas_url.py (+2/-2) src/maascluster/tests/test_customize_config.py (+2/-2) src/maascluster/tests/test_diskless.py (+15/-17) src/maascluster/tests/test_events.py (+11/-11) src/maascluster/tests/test_kernel_opts.py (+5/-5) src/maascluster/tests/test_network.py (+1/-1) src/maascluster/tests/test_path.py (+11/-11) src/maascluster/tests/test_plugin.py (+17/-19) src/maascluster/tests/test_plugin_services.py (+1/-1) src/maascluster/tests/test_security.py (+6/-6) src/maascluster/tests/test_tags.py (+2/-2) src/maascluster/tests/test_udev.py (+3/-3) src/maascluster/tests/test_upgrade_cluster.py (+6/-6) src/maascluster/upgrade_cluster.py (+5/-5) src/maascluster/utils/__init__.py (+7/-7) src/maascluster/utils/fs.py (+2/-2) src/maascluster/utils/network.py (+1/-1) src/maascluster/utils/script.py (+2/-2) src/maascluster/utils/testing.py (+2/-2) src/maascluster/utils/tests/test_backoff.py (+5/-5) src/maascluster/utils/tests/test_curtin.py (+3/-3) src/maascluster/utils/tests/test_enum.py (+2/-2) src/maascluster/utils/tests/test_env.py (+1/-1) src/maascluster/utils/tests/test_fs.py (+11/-11) src/maascluster/utils/tests/test_introspect.py (+9/-9) src/maascluster/utils/tests/test_network.py (+14/-14) src/maascluster/utils/tests/test_registry.py (+3/-3) src/maascluster/utils/tests/test_script.py (+7/-7) src/maascluster/utils/tests/test_shell.py (+4/-4) src/maascluster/utils/tests/test_text.py (+3/-3) src/maascluster/utils/tests/test_tftp.py (+2/-2) src/maascluster/utils/tests/test_twisted.py (+14/-14) src/maascluster/utils/tests/test_url.py (+1/-1) src/maascluster/utils/tests/test_utils.py (+30/-30) src/maascluster/utils/tests/test_xpath.py (+1/-1) src/maasfascist.py (+4/-4) src/maasserver/api/boot_images.py (+1/-1) src/maasserver/api/doc.py (+1/-1) src/maasserver/api/ip_addresses.py (+1/-1) src/maasserver/api/logger.py (+1/-1) src/maasserver/api/nodes.py (+7/-7) src/maasserver/api/pxeconfig.py (+4/-4) src/maasserver/api/tests/test_boot_images.py (+1/-1) src/maasserver/api/tests/test_doc.py (+1/-1) src/maasserver/api/tests/test_ipaddresses.py (+1/-1) src/maasserver/api/tests/test_node.py (+2/-2) src/maasserver/api/tests/test_nodegroup.py (+10/-10) src/maasserver/api/tests/test_nodes.py (+5/-5) src/maasserver/api/tests/test_pxeconfig.py (+3/-3) src/maasserver/bootresources.py (+14/-14) src/maasserver/bootsources.py (+7/-7) src/maasserver/clusterrpc/architecture.py (+1/-1) src/maasserver/clusterrpc/boot_images.py (+5/-5) src/maasserver/clusterrpc/dhcp.py (+8/-8) src/maasserver/clusterrpc/osystems.py (+9/-9) src/maasserver/clusterrpc/power.py (+4/-4) src/maasserver/clusterrpc/power_parameters.py (+7/-7) src/maasserver/clusterrpc/testing/power_parameters.py (+1/-1) src/maasserver/clusterrpc/tests/test_boot_images.py (+13/-13) src/maasserver/clusterrpc/tests/test_dhcp.py (+5/-5) src/maasserver/clusterrpc/tests/test_osystems.py (+1/-1) src/maasserver/clusterrpc/tests/test_power.py (+5/-5) src/maasserver/clusterrpc/tests/test_power_parameters.py (+5/-5) src/maasserver/clusterrpc/tests/test_utils.py (+4/-4) src/maasserver/clusterrpc/utils.py (+4/-4) src/maasserver/compose_preseed.py (+4/-4) src/maasserver/config.py (+1/-1) src/maasserver/dhcp.py (+9/-9) src/maasserver/dns/config.py (+14/-14) src/maasserver/dns/tests/test_config.py (+14/-14) src/maasserver/dns/tests/test_zonegenerator.py (+6/-6) src/maasserver/dns/zonegenerator.py (+5/-5) src/maasserver/event_connect.py (+4/-4) src/maasserver/eventloop.py (+1/-1) src/maasserver/forms.py (+14/-14) src/maasserver/management/commands/edit_named_options.py (+1/-1) src/maasserver/management/commands/get_named_conf.py (+1/-1) src/maasserver/management/commands/set_up_dns.py (+1/-1) src/maasserver/middleware.py (+6/-6) src/maasserver/migrations/0072_remove_ipmi_autodetect.py (+1/-1) src/maasserver/models/config.py (+1/-1) src/maasserver/models/event.py (+2/-2) src/maasserver/models/macaddress.py (+1/-1) src/maasserver/models/network.py (+1/-1) src/maasserver/models/node.py (+10/-10) src/maasserver/models/nodegroup.py (+12/-12) src/maasserver/models/nodegroupinterface.py (+5/-5) src/maasserver/models/staticipaddress.py (+2/-2) src/maasserver/models/tests/test_components.py (+1/-1) src/maasserver/models/tests/test_event.py (+1/-1) src/maasserver/models/tests/test_network.py (+1/-1) src/maasserver/models/tests/test_node.py (+11/-11) src/maasserver/models/tests/test_nodegroup.py (+13/-13) src/maasserver/models/tests/test_staticipaddress.py (+1/-1) src/maasserver/node_action.py (+7/-7) src/maasserver/node_query.py (+16/-16) src/maasserver/node_status.py (+1/-1) src/maasserver/nonces_cleanup.py (+1/-1) src/maasserver/plugin.py (+5/-7) src/maasserver/populate_tags.py (+10/-10) src/maasserver/preseed.py (+5/-5) src/maasserver/rpc/__init__.py (+3/-3) src/maasserver/rpc/clusters.py (+4/-4) src/maasserver/rpc/configuration.py (+3/-3) src/maasserver/rpc/events.py (+6/-6) src/maasserver/rpc/leases.py (+7/-7) src/maasserver/rpc/monitors.py (+6/-6) src/maasserver/rpc/nodes.py (+11/-11) src/maasserver/rpc/regionservice.py (+37/-37) src/maasserver/rpc/testing/fixtures.py (+14/-14) src/maasserver/rpc/testing/mixins.py (+5/-5) src/maasserver/rpc/tests/test_clusters.py (+1/-1) src/maasserver/rpc/tests/test_module.py (+1/-1) src/maasserver/rpc/tests/test_monitors.py (+4/-4) src/maasserver/rpc/tests/test_nodes.py (+12/-12) src/maasserver/rpc/tests/test_regionservice.py (+47/-47) src/maasserver/security.py (+5/-5) src/maasserver/server_address.py (+1/-1) src/maasserver/start_up.py (+8/-8) src/maasserver/testing/config.py (+1/-1) src/maasserver/testing/factory.py (+1/-1) src/maasserver/tests/test_bootresources.py (+4/-4) src/maasserver/tests/test_bootsources.py (+5/-7) src/maasserver/tests/test_commands_edit_named_options.py (+1/-1) src/maasserver/tests/test_commands_set_up_dns.py (+5/-5) src/maasserver/tests/test_compose_preseed.py (+6/-6) src/maasserver/tests/test_dhcp.py (+6/-6) src/maasserver/tests/test_event_connect.py (+4/-4) src/maasserver/tests/test_forms_node.py (+4/-4) src/maasserver/tests/test_forms_nodegroup.py (+1/-1) src/maasserver/tests/test_middleware.py (+6/-6) src/maasserver/tests/test_monitor_connect.py (+1/-1) src/maasserver/tests/test_node_action.py (+2/-2) src/maasserver/tests/test_node_query.py (+10/-10) src/maasserver/tests/test_plugin.py (+4/-4) src/maasserver/tests/test_populate_tags.py (+7/-7) src/maasserver/tests/test_preseed.py (+6/-6) src/maasserver/tests/test_security.py (+1/-1) src/maasserver/tests/test_webapp.py (+1/-1) src/maasserver/third_party_drivers.py (+2/-2) src/maasserver/utils/__init__.py (+1/-1) src/maasserver/utils/async.py (+2/-2) src/maasserver/utils/jsenums.py (+2/-2) src/maasserver/utils/orm.py (+4/-4) src/maasserver/utils/tests/test_async.py (+1/-1) src/maasserver/utils/tests/test_jsenums.py (+1/-1) src/maasserver/utils/tests/test_orm.py (+4/-4) src/maasserver/utils/views.py (+1/-1) src/maasserver/views/nodes.py (+1/-1) src/maasserver/views/tests/test_clusters.py (+1/-1) src/maasserver/views/tests/test_rpc.py (+1/-1) src/maasserver/webapp.py (+1/-1) src/maasserver/websockets/base.py (+1/-1) src/maasserver/websockets/handlers/device.py (+1/-1) src/maasserver/websockets/handlers/node.py (+9/-9) src/maasserver/websockets/handlers/tests/test_node.py (+6/-6) src/maasserver/websockets/listener.py (+2/-2) src/maasserver/websockets/protocol.py (+4/-4) src/maasserver/websockets/tests/test_listener.py (+1/-1) src/maasserver/websockets/tests/test_protocol.py (+1/-1) src/maasserver/x509.py (+2/-2) src/maastesting/__init__.py (+1/-1) src/metadataserver/address.py (+1/-1) src/metadataserver/api.py (+4/-4) src/metadataserver/tests/test_api.py (+4/-4) src/metadataserver/user_data/snippets.py (+2/-2) twisted/plugins/maasclusterd.py (+1/-1) utilities/find-imported-module-files (+1/-1) utilities/find-imported-modules (+1/-1) |
To merge this branch: | bzr merge lp:~allenap/maas/rename-to-maascluster |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | mentor | Abstain | |
Raphaël Badin (community) | Approve | ||
Ricardo Bánffy (community) | Approve | ||
Review via email: mp+257972@code.launchpad.net |
Commit message
Rename provisioningserver to maascluster.
This begins a normalisation of MAAS's packages.
Description of the change
A packaging change will be landed at the same time. I've tested both together and they pass CI. This is an entirely mechanical change.
To post a comment you must log in.
Revision history for this message
Ricardo Bánffy (rbanffy) : | # |
review:
Approve
Revision history for this message
Gavin Panella (allenap) wrote : | # |
> Looks good… but right now is probably the worse possible moment to land
> something like this…
Agreed :)
review:
Abstain
(mentor)
Revision history for this message
MAAS Lander (maas-lander) wrote : | # |
Transitioned to Git.
lp:maas has now moved from Bzr to Git.
Please propose your branches with Launchpad using Git.
git clone https:/
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'MANIFEST.in' |
2 | --- MANIFEST.in 2013-06-05 10:44:25 +0000 |
3 | +++ MANIFEST.in 2015-05-01 07:23:47 +0000 |
4 | @@ -2,9 +2,9 @@ |
5 | graft src/*/templates |
6 | graft src/*/fixtures |
7 | graft src/*/specs |
8 | -graft src/provisioningserver/* |
9 | +graft src/maascluster/* |
10 | graft src/metadataserver/commissioning |
11 | prune src/*/testing |
12 | prune src/*/tests |
13 | prune src/maastesting |
14 | -prune src/provisioningserver/*/tests |
15 | +prune src/maascluster/*/tests |
16 | |
17 | === modified file 'buildout.cfg' |
18 | --- buildout.cfg 2015-04-10 13:58:31 +0000 |
19 | +++ buildout.cfg 2015-05-01 07:23:47 +0000 |
20 | @@ -170,8 +170,8 @@ |
21 | eggs = |
22 | crochet |
23 | entry-points = |
24 | - maas-probe-dhcp=provisioningserver.dhcp.probe:main |
25 | - maas-provision=provisioningserver.__main__:main |
26 | + maas-probe-dhcp=maascluster.dhcp.probe:main |
27 | + maas-provision=maascluster.__main__:main |
28 | twistd.cluster=twisted.scripts.twistd:run |
29 | extra-paths = |
30 | ${common:extra-paths} |
31 | @@ -195,8 +195,8 @@ |
32 | ${common:initialization} |
33 | sys.argv[1:1] = [ |
34 | "--with-select", |
35 | - "--select-dir=src/provisioningserver", |
36 | - "--cover-package=provisioningserver", |
37 | + "--select-dir=src/maascluster", |
38 | + "--cover-package=maascluster", |
39 | ] |
40 | extra-paths = ${cluster:extra-paths} |
41 | scripts = |
42 | |
43 | === modified file 'docs/development/rpc.rst' |
44 | --- docs/development/rpc.rst 2014-08-21 20:10:47 +0000 |
45 | +++ docs/development/rpc.rst 2015-05-01 07:23:47 +0000 |
46 | @@ -17,7 +17,7 @@ |
47 | Where do I start? |
48 | ----------------- |
49 | |
50 | -Start in the :py:mod:`provisioningserver.rpc` package. The first two files to |
51 | +Start in the :py:mod:`maascluster.rpc` package. The first two files to |
52 | look at are ``cluster.py`` and ``region.py``. This contain the |
53 | declarations of what commands are available on clusters and regions |
54 | respectively. |
55 | @@ -46,7 +46,7 @@ |
56 | --------------------- |
57 | |
58 | To implement a new command on the cluster, see the class |
59 | -:py:class:`provisioningserver.rpc.clusterserver.Cluster`. A method decorated |
60 | +:py:class:`maascluster.rpc.clusterserver.Cluster`. A method decorated |
61 | with ``@cluster.EatCheez.responder`` is the implementation of the |
62 | ``EatCheez`` command. There's no trick to this, they're just plain old |
63 | functions. However: |
64 | @@ -88,9 +88,9 @@ |
65 | |
66 | Probably the best way to do this is implement the behaviour you want as |
67 | a new service, start it up via same mechanism as the ``rpc`` service |
68 | -(see :py:mod:`provisioningserver.plugin`, and pass over a reference. |
69 | +(see :py:mod:`maascluster.plugin`, and pass over a reference. |
70 | |
71 | -Then call :py:func:`~provisioningserver.rpc.getClient`, and you will get |
72 | +Then call :py:func:`~maascluster.rpc.getClient`, and you will get |
73 | a client for calling into a region process. You're given a random |
74 | client. |
75 | |
76 | @@ -150,7 +150,7 @@ |
77 | RPC declarations for region controllers |
78 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
79 | |
80 | -.. automodule:: provisioningserver.rpc.region |
81 | +.. automodule:: maascluster.rpc.region |
82 | |
83 | |
84 | RPC implementation for region controllers |
85 | @@ -162,13 +162,13 @@ |
86 | RPC declarations for cluster controllers |
87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
88 | |
89 | -.. automodule:: provisioningserver.rpc.cluster |
90 | +.. automodule:: maascluster.rpc.cluster |
91 | |
92 | |
93 | RPC implementation for cluster controllers |
94 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
95 | |
96 | -.. autoclass:: provisioningserver.rpc.clusterservice.Cluster |
97 | +.. autoclass:: maascluster.rpc.clusterservice.Cluster |
98 | |
99 | |
100 | Helpers |
101 | @@ -178,4 +178,4 @@ |
102 | .. autofunction:: maasserver.rpc.getClientFor |
103 | .. autofunction:: maasserver.utils.async.gather |
104 | |
105 | -.. automethod:: provisioningserver.rpc.clusterservice.ClusterClientService.getClient |
106 | +.. automethod:: maascluster.rpc.clusterservice.ClusterClientService.getClient |
107 | |
108 | === modified file 'docs/development/tagging.rst' |
109 | --- docs/development/tagging.rst 2014-11-14 23:11:14 +0000 |
110 | +++ docs/development/tagging.rst 2015-05-01 07:23:47 +0000 |
111 | @@ -27,7 +27,7 @@ |
112 | out to cluster controllers. Here's how: |
113 | |
114 | #. The region dispatches a |
115 | - ``provisioningserver.tasks.update_node_tags`` job to each cluster |
116 | + ``maascluster.tasks.update_node_tags`` job to each cluster |
117 | for each tag it wants evaluated. |
118 | |
119 | It sends the tag name and its definition, an XPath expression. |
120 | @@ -36,30 +36,30 @@ |
121 | ``maasserver.populate_tags``. |
122 | |
123 | #. The task is run (by Celery) on each cluster. This calls |
124 | - ``provisioningserver.tags.process_node_tags``. |
125 | + ``maascluster.tags.process_node_tags``. |
126 | |
127 | #. The system IDs for all nodes in that cluster (aka node group) are |
128 | fetched by calling back to the region. |
129 | |
130 | - See ``provisioningserver.tags.get_nodes_for_node_group``. |
131 | + See ``maascluster.tags.get_nodes_for_node_group``. |
132 | |
133 | #. Nodes are then processed in batches. For each batch: |
134 | |
135 | #. Hardware details are obtained from the region for the batch as a |
136 | whole. |
137 | |
138 | - See ``provisioningserver.tags.get_hardware_details_for_nodes``. |
139 | + See ``maascluster.tags.get_hardware_details_for_nodes``. |
140 | |
141 | #. The tag expression is evaluated against each node's hardware |
142 | details. The result of the expression, cast as a boolean, |
143 | determines if the tag applies to this node. |
144 | |
145 | - See ``provisioningserver.tags.process_batch``. |
146 | + See ``maascluster.tags.process_batch``. |
147 | |
148 | #. The results are sent back to the region for the batch as a |
149 | whole. |
150 | |
151 | - See ``provisioningserver.tags.post_updated_nodes``. |
152 | + See ``maascluster.tags.post_updated_nodes``. |
153 | |
154 | |
155 | New or updated commissioning result |
156 | |
157 | === modified file 'etc/maas/templates/power/apc.template' |
158 | --- etc/maas/templates/power/apc.template 2015-02-06 02:32:26 +0000 |
159 | +++ etc/maas/templates/power/apc.template 2015-05-01 07:23:47 +0000 |
160 | @@ -13,7 +13,7 @@ |
161 | issue_apc_command() { |
162 | python - << 'END' |
163 | import sys |
164 | -from provisioningserver.drivers.hardware.apc import power_control_apc |
165 | +from maascluster.drivers.hardware.apc import power_control_apc |
166 | try: |
167 | power_control_apc( |
168 | {{escape_py_literal(power_address) | safe}}, |
169 | @@ -33,7 +33,7 @@ |
170 | query_state() { |
171 | python - << 'END' |
172 | import sys |
173 | -from provisioningserver.drivers.hardware.apc import power_state_apc |
174 | +from maascluster.drivers.hardware.apc import power_state_apc |
175 | try: |
176 | print(power_state_apc( |
177 | {{escape_py_literal(power_address) | safe}}, |
178 | |
179 | === modified file 'etc/maas/templates/power/esxi.template' |
180 | --- etc/maas/templates/power/esxi.template 2015-02-19 17:31:32 +0000 |
181 | +++ etc/maas/templates/power/esxi.template 2015-05-01 07:23:47 +0000 |
182 | @@ -13,7 +13,7 @@ |
183 | issue_virsh_command() { |
184 | python - << END |
185 | import sys |
186 | -from provisioningserver.drivers.hardware.esxi import power_control_esxi |
187 | +from maascluster.drivers.hardware.esxi import power_control_esxi |
188 | try: |
189 | power_control_esxi( |
190 | {{escape_py_literal(power_address).decode("ascii") | safe}}, |
191 | @@ -33,7 +33,7 @@ |
192 | query_state() { |
193 | python - << END |
194 | import sys |
195 | -from provisioningserver.drivers.hardware.esxi import power_state_esxi |
196 | +from maascluster.drivers.hardware.esxi import power_state_esxi |
197 | try: |
198 | print(power_state_esxi( |
199 | {{escape_py_literal(power_address).decode("ascii") | safe}}, |
200 | |
201 | === modified file 'etc/maas/templates/power/mscm.template' |
202 | --- etc/maas/templates/power/mscm.template 2014-10-28 21:48:26 +0000 |
203 | +++ etc/maas/templates/power/mscm.template 2015-05-01 07:23:47 +0000 |
204 | @@ -12,7 +12,7 @@ |
205 | issue_mscm_command() { |
206 | python - << END |
207 | import sys |
208 | -from provisioningserver.drivers.hardware.mscm import power_control_mscm |
209 | +from maascluster.drivers.hardware.mscm import power_control_mscm |
210 | try: |
211 | power_control_mscm( |
212 | {{escape_py_literal(power_address) | safe}}, |
213 | @@ -32,7 +32,7 @@ |
214 | query_state() { |
215 | python - << END |
216 | import sys |
217 | -from provisioningserver.drivers.hardware.mscm import power_state_mscm |
218 | +from maascluster.drivers.hardware.mscm import power_state_mscm |
219 | try: |
220 | print(power_state_mscm( |
221 | {{escape_py_literal(power_address) | safe}}, |
222 | |
223 | === modified file 'etc/maas/templates/power/msftocs.template' |
224 | --- etc/maas/templates/power/msftocs.template 2015-02-23 20:02:45 +0000 |
225 | +++ etc/maas/templates/power/msftocs.template 2015-05-01 07:23:47 +0000 |
226 | @@ -12,7 +12,7 @@ |
227 | issue_msftocs_command() { |
228 | python - << 'END' |
229 | import sys |
230 | -from provisioningserver.drivers.hardware.msftocs import power_control_msftocs |
231 | +from maascluster.drivers.hardware.msftocs import power_control_msftocs |
232 | try: |
233 | power_control_msftocs( |
234 | {{escape_py_literal(power_address) | safe}}, |
235 | @@ -33,7 +33,7 @@ |
236 | query_state() { |
237 | python - << 'END' |
238 | import sys |
239 | -from provisioningserver.drivers.hardware.msftocs import power_state_msftocs |
240 | +from maascluster.drivers.hardware.msftocs import power_state_msftocs |
241 | try: |
242 | print(power_state_msftocs( |
243 | {{escape_py_literal(power_address) | safe}}, |
244 | |
245 | === modified file 'etc/maas/templates/power/sm15k.template' |
246 | --- etc/maas/templates/power/sm15k.template 2014-12-09 15:51:13 +0000 |
247 | +++ etc/maas/templates/power/sm15k.template 2015-05-01 07:23:47 +0000 |
248 | @@ -23,7 +23,7 @@ |
249 | issue_rest_v09_command() { |
250 | python - << END |
251 | import sys |
252 | -from provisioningserver.drivers.hardware.seamicro import power_control_seamicro15k_v09 |
253 | +from maascluster.drivers.hardware.seamicro import power_control_seamicro15k_v09 |
254 | try: |
255 | power_control_seamicro15k_v09( |
256 | {{escape_py_literal(power_address) | safe}}, |
257 | @@ -44,7 +44,7 @@ |
258 | issue_rest_v2_command() { |
259 | python - << END |
260 | import sys |
261 | -from provisioningserver.drivers.hardware.seamicro import power_control_seamicro15k_v2 |
262 | +from maascluster.drivers.hardware.seamicro import power_control_seamicro15k_v2 |
263 | try: |
264 | power_control_seamicro15k_v2( |
265 | {{escape_py_literal(power_address) | safe}}, |
266 | @@ -65,7 +65,7 @@ |
267 | query_state_rest_v2() { |
268 | python - << END |
269 | import sys |
270 | -from provisioningserver.drivers.hardware.seamicro import power_query_seamicro15k_v2 |
271 | +from maascluster.drivers.hardware.seamicro import power_query_seamicro15k_v2 |
272 | try: |
273 | print(power_query_seamicro15k_v2( |
274 | {{escape_py_literal(power_address) | safe}}, |
275 | |
276 | === modified file 'etc/maas/templates/power/ucsm.template' |
277 | --- etc/maas/templates/power/ucsm.template 2014-12-09 15:51:13 +0000 |
278 | +++ etc/maas/templates/power/ucsm.template 2015-05-01 07:23:47 +0000 |
279 | @@ -12,7 +12,7 @@ |
280 | issue_ucsm_command() { |
281 | python - << END |
282 | import sys |
283 | -from provisioningserver.drivers.hardware.ucsm import power_control_ucsm |
284 | +from maascluster.drivers.hardware.ucsm import power_control_ucsm |
285 | try: |
286 | power_control_ucsm( |
287 | {{escape_py_literal(power_address) | safe}}, |
288 | @@ -32,7 +32,7 @@ |
289 | query_state() { |
290 | python - << END |
291 | import sys |
292 | -from provisioningserver.drivers.hardware.ucsm import power_state_ucsm |
293 | +from maascluster.drivers.hardware.ucsm import power_state_ucsm |
294 | try: |
295 | print(power_state_ucsm( |
296 | {{escape_py_literal(power_address) | safe}}, |
297 | |
298 | === modified file 'etc/maas/templates/power/virsh.template' |
299 | --- etc/maas/templates/power/virsh.template 2014-10-02 10:12:02 +0000 |
300 | +++ etc/maas/templates/power/virsh.template 2015-05-01 07:23:47 +0000 |
301 | @@ -13,7 +13,7 @@ |
302 | issue_virsh_command() { |
303 | python - << END |
304 | import sys |
305 | -from provisioningserver.drivers.hardware.virsh import power_control_virsh |
306 | +from maascluster.drivers.hardware.virsh import power_control_virsh |
307 | try: |
308 | power_control_virsh( |
309 | {{repr(power_address).decode("ascii") | safe}}, |
310 | @@ -32,7 +32,7 @@ |
311 | query_state() { |
312 | python - << END |
313 | import sys |
314 | -from provisioningserver.drivers.hardware.virsh import power_state_virsh |
315 | +from maascluster.drivers.hardware.virsh import power_state_virsh |
316 | try: |
317 | print(power_state_virsh( |
318 | {{repr(power_address).decode("ascii") | safe}}, |
319 | |
320 | === modified file 'etc/maas/templates/power/vsphere.template' |
321 | --- etc/maas/templates/power/vsphere.template 2015-04-14 21:35:37 +0000 |
322 | +++ etc/maas/templates/power/vsphere.template 2015-05-01 07:23:47 +0000 |
323 | @@ -12,7 +12,7 @@ |
324 | issue_vsphere_command() { |
325 | python - << END |
326 | import sys |
327 | -from provisioningserver.drivers.hardware.vsphere import power_control_vsphere |
328 | +from maascluster.drivers.hardware.vsphere import power_control_vsphere |
329 | try: |
330 | power_control_vsphere( |
331 | {{escape_py_literal(power_address) | safe}}, |
332 | @@ -35,7 +35,7 @@ |
333 | query_state() { |
334 | python - << END |
335 | import sys |
336 | -from provisioningserver.drivers.hardware.vsphere import power_query_vsphere |
337 | +from maascluster.drivers.hardware.vsphere import power_query_vsphere |
338 | try: |
339 | print(power_query_vsphere( |
340 | {{escape_py_literal(power_address) | safe}}, |
341 | |
342 | === modified file 'scripts/ampclient.py' |
343 | --- scripts/ampclient.py 2014-01-31 16:15:00 +0000 |
344 | +++ scripts/ampclient.py 2015-05-01 07:23:47 +0000 |
345 | @@ -16,13 +16,13 @@ |
346 | |
347 | import sys |
348 | |
349 | -from provisioningserver.rpc.cluster import ListBootImages |
350 | -from provisioningserver.rpc.region import ReportBootImages |
351 | +from maascluster.rpc.cluster import ListBootImages |
352 | +from maascluster.rpc.region import ReportBootImages |
353 | from twisted.internet import reactor |
354 | from twisted.internet.endpoints import ( |
355 | connectProtocol, |
356 | TCP4ClientEndpoint, |
357 | - ) |
358 | +) |
359 | from twisted.protocols.amp import AMP |
360 | |
361 | |
362 | |
363 | === modified file 'scripts/maas-import-pxe-files' |
364 | --- scripts/maas-import-pxe-files 2014-09-11 22:10:16 +0000 |
365 | +++ scripts/maas-import-pxe-files 2015-05-01 07:23:47 +0000 |
366 | @@ -16,7 +16,7 @@ |
367 | __metaclass__ = type |
368 | |
369 | import logging |
370 | -from provisioningserver.import_images.boot_resources import ( |
371 | +from maascluster.import_images.boot_resources import ( |
372 | maaslog, |
373 | main_with_services, |
374 | make_arg_parser, |
375 | |
376 | === modified file 'scripts/uec2roottar' |
377 | --- scripts/uec2roottar 2014-07-18 17:05:57 +0000 |
378 | +++ scripts/uec2roottar 2015-05-01 07:23:47 +0000 |
379 | @@ -18,7 +18,7 @@ |
380 | |
381 | __metaclass__ = type |
382 | |
383 | -from provisioningserver.import_images import uec2roottar |
384 | +from maascluster.import_images import uec2roottar |
385 | |
386 | |
387 | if __name__ == "__main__": |
388 | |
389 | === modified file 'services/dns/run' |
390 | --- services/dns/run 2014-09-30 09:38:15 +0000 |
391 | +++ services/dns/run 2015-05-01 07:23:47 +0000 |
392 | @@ -27,7 +27,7 @@ |
393 | rndc_port="$MAAS_DNS_RNDC_PORT" |
394 | |
395 | # Create DNS config. |
396 | -bin/py -m provisioningserver/testing/bindfixture -- \ |
397 | +bin/py -m maascluster/testing/bindfixture -- \ |
398 | --create-config-only --overwrite-config \ |
399 | --homedir "${homedir}" --port "${port}" \ |
400 | --rndc-port "${rndc_port}" |
401 | @@ -42,6 +42,6 @@ |
402 | |
403 | # Run named. |
404 | exec $(command -v authbind && echo --deep) \ |
405 | - bin/py -m provisioningserver/testing/bindfixture -- \ |
406 | + bin/py -m maascluster/testing/bindfixture -- \ |
407 | --homedir "${homedir}" --port "${port}" \ |
408 | --rndc-port "${rndc_port}" |
409 | |
410 | === modified file 'src/maas/customise_test_db.py' |
411 | --- src/maas/customise_test_db.py 2014-11-28 15:33:11 +0000 |
412 | +++ src/maas/customise_test_db.py 2015-05-01 07:23:47 +0000 |
413 | @@ -19,7 +19,7 @@ |
414 | import os.path |
415 | |
416 | import django.db.backends.postgresql_psycopg2.creation as backend_creation |
417 | -from provisioningserver.utils.shell import call_and_check |
418 | +from maascluster.utils.shell import call_and_check |
419 | |
420 | |
421 | def patch_db_creation(db_path, dump_path): |
422 | |
423 | === modified file 'src/maas/development.py' |
424 | --- src/maas/development.py 2015-04-21 22:51:42 +0000 |
425 | +++ src/maas/development.py 2015-05-01 07:23:47 +0000 |
426 | @@ -23,9 +23,9 @@ |
427 | settings, |
428 | ) |
429 | from maas.customise_test_db import patch_db_creation |
430 | +import maascluster.config |
431 | +from maascluster.utils.url import compose_URL |
432 | from metadataserver.address import guess_server_host |
433 | -import provisioningserver.config |
434 | -from provisioningserver.utils.url import compose_URL |
435 | |
436 | # We expect the following settings to be overridden. They are mentioned here |
437 | # to silence lint warnings. |
438 | @@ -103,7 +103,7 @@ |
439 | patch_db_creation(abspath('db'), abspath('schema/baseline.sql')) |
440 | |
441 | # Override the default provisioning config filename. |
442 | -provisioningserver.config.Config.DEFAULT_FILENAME = abspath( |
443 | +maascluster.config.Config.DEFAULT_FILENAME = abspath( |
444 | "etc/maas/pserv.yaml") |
445 | |
446 | # Use the in-branch development version of maas_cluster.conf. |
447 | |
448 | === modified file 'src/maas/settings.py' |
449 | --- src/maas/settings.py 2015-04-14 13:55:02 +0000 |
450 | +++ src/maas/settings.py 2015-05-01 07:23:47 +0000 |
451 | @@ -22,13 +22,13 @@ |
452 | import_local_settings, |
453 | ) |
454 | from maas.monkey import patch_get_script_prefix |
455 | -from metadataserver.address import guess_server_host |
456 | -from provisioningserver.logger import ( |
457 | +from maascluster.logger import ( |
458 | DEFAULT_LOG_FORMAT, |
459 | DEFAULT_LOG_FORMAT_DATE, |
460 | DEFAULT_LOG_LEVEL, |
461 | ) |
462 | -from provisioningserver.utils.url import compose_URL |
463 | +from maascluster.utils.url import compose_URL |
464 | +from metadataserver.address import guess_server_host |
465 | |
466 | # Use new style url tag: |
467 | # https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi |
468 | |
469 | === renamed directory 'src/provisioningserver' => 'src/maascluster' |
470 | === modified file 'src/maascluster/__main__.py' |
471 | --- src/provisioningserver/__main__.py 2015-03-30 18:05:57 +0000 |
472 | +++ src/maascluster/__main__.py 2015-05-01 07:23:47 +0000 |
473 | @@ -14,15 +14,15 @@ |
474 | |
475 | __metaclass__ = type |
476 | |
477 | -from provisioningserver import security |
478 | -import provisioningserver.boot.install_bootloader |
479 | -import provisioningserver.boot.install_grub |
480 | -import provisioningserver.cluster_config_command |
481 | -import provisioningserver.configure_maas_url |
482 | -import provisioningserver.customize_config |
483 | -import provisioningserver.dhcp.writer |
484 | -import provisioningserver.upgrade_cluster |
485 | -from provisioningserver.utils.script import ( |
486 | +from maascluster import security |
487 | +import maascluster.boot.install_bootloader |
488 | +import maascluster.boot.install_grub |
489 | +import maascluster.cluster_config_command |
490 | +import maascluster.configure_maas_url |
491 | +import maascluster.customize_config |
492 | +import maascluster.dhcp.writer |
493 | +import maascluster.upgrade_cluster |
494 | +from maascluster.utils.script import ( |
495 | AtomicWriteScript, |
496 | MainScript, |
497 | ) |
498 | @@ -31,13 +31,13 @@ |
499 | script_commands = { |
500 | 'atomic-write': AtomicWriteScript, |
501 | 'check-for-shared-secret': security.CheckForSharedSecretScript, |
502 | - 'configure-maas-url': provisioningserver.configure_maas_url, |
503 | - 'customize-config': provisioningserver.customize_config, |
504 | - 'generate-dhcp-config': provisioningserver.dhcp.writer, |
505 | + 'configure-maas-url': maascluster.configure_maas_url, |
506 | + 'customize-config': maascluster.customize_config, |
507 | + 'generate-dhcp-config': maascluster.dhcp.writer, |
508 | 'install-shared-secret': security.InstallSharedSecretScript, |
509 | - 'install-uefi-config': provisioningserver.boot.install_grub, |
510 | - 'upgrade-cluster': provisioningserver.upgrade_cluster, |
511 | - 'config': provisioningserver.cluster_config_command, |
512 | + 'install-uefi-config': maascluster.boot.install_grub, |
513 | + 'upgrade-cluster': maascluster.upgrade_cluster, |
514 | + 'config': maascluster.cluster_config_command, |
515 | } |
516 | |
517 | |
518 | |
519 | === modified file 'src/maascluster/auth.py' |
520 | --- src/provisioningserver/auth.py 2014-09-23 19:38:17 +0000 |
521 | +++ src/maascluster/auth.py 2015-05-01 07:23:47 +0000 |
522 | @@ -16,7 +16,7 @@ |
523 | 'get_maas_user_gpghome', |
524 | ] |
525 | |
526 | -from provisioningserver.path import get_path |
527 | +from maascluster.path import get_path |
528 | |
529 | |
530 | def get_maas_user_gpghome(): |
531 | |
532 | === modified file 'src/maascluster/boot/__init__.py' |
533 | --- src/provisioningserver/boot/__init__.py 2015-03-25 15:33:23 +0000 |
534 | +++ src/maascluster/boot/__init__.py 2015-05-01 07:23:47 +0000 |
535 | @@ -26,14 +26,14 @@ |
536 | from io import BytesIO |
537 | from os import path |
538 | |
539 | -from provisioningserver.boot.tftppath import compose_image_path |
540 | -from provisioningserver.kernel_opts import compose_kernel_command_line |
541 | -from provisioningserver.utils import ( |
542 | +from maascluster.boot.tftppath import compose_image_path |
543 | +from maascluster.kernel_opts import compose_kernel_command_line |
544 | +from maascluster.utils import ( |
545 | locate_config, |
546 | tftp, |
547 | ) |
548 | -from provisioningserver.utils.network import find_mac_via_arp |
549 | -from provisioningserver.utils.registry import Registry |
550 | +from maascluster.utils.network import find_mac_via_arp |
551 | +from maascluster.utils.registry import Registry |
552 | import tempita |
553 | from tftp.backend import IReader |
554 | from zope.interface import implementer |
555 | @@ -252,11 +252,11 @@ |
556 | |
557 | |
558 | # Import the supported boot methods after defining BootMethod. |
559 | -from provisioningserver.boot.pxe import PXEBootMethod |
560 | -from provisioningserver.boot.uefi import UEFIBootMethod |
561 | -from provisioningserver.boot.powerkvm import PowerKVMBootMethod |
562 | -from provisioningserver.boot.powernv import PowerNVBootMethod |
563 | -from provisioningserver.boot.windows import WindowsPXEBootMethod |
564 | +from maascluster.boot.pxe import PXEBootMethod |
565 | +from maascluster.boot.uefi import UEFIBootMethod |
566 | +from maascluster.boot.powerkvm import PowerKVMBootMethod |
567 | +from maascluster.boot.powernv import PowerNVBootMethod |
568 | +from maascluster.boot.windows import WindowsPXEBootMethod |
569 | |
570 | |
571 | builtin_boot_methods = [ |
572 | |
573 | === modified file 'src/maascluster/boot/install_bootloader.py' |
574 | --- src/provisioningserver/boot/install_bootloader.py 2014-03-31 10:30:24 +0000 |
575 | +++ src/maascluster/boot/install_bootloader.py 2015-05-01 07:23:47 +0000 |
576 | @@ -21,7 +21,7 @@ |
577 | import os.path |
578 | from shutil import copyfile |
579 | |
580 | -from provisioningserver.boot.tftppath import locate_tftp_path |
581 | +from maascluster.boot.tftppath import locate_tftp_path |
582 | |
583 | |
584 | def make_destination(tftproot): |
585 | |
586 | === modified file 'src/maascluster/boot/install_grub.py' |
587 | --- src/provisioningserver/boot/install_grub.py 2015-02-24 20:11:09 +0000 |
588 | +++ src/maascluster/boot/install_grub.py 2015-05-01 07:23:47 +0000 |
589 | @@ -19,9 +19,9 @@ |
590 | |
591 | import os.path |
592 | |
593 | -from provisioningserver.boot.install_bootloader import make_destination |
594 | -from provisioningserver.config import Config |
595 | -from provisioningserver.utils.fs import write_text_file |
596 | +from maascluster.boot.install_bootloader import make_destination |
597 | +from maascluster.config import Config |
598 | +from maascluster.utils.fs import write_text_file |
599 | |
600 | |
601 | CONFIG_FILE = """ |
602 | |
603 | === modified file 'src/maascluster/boot/powerkvm.py' |
604 | --- src/provisioningserver/boot/powerkvm.py 2015-03-25 15:33:23 +0000 |
605 | +++ src/maascluster/boot/powerkvm.py 2015-05-01 07:23:47 +0000 |
606 | @@ -20,14 +20,14 @@ |
607 | import os.path |
608 | from textwrap import dedent |
609 | |
610 | -from provisioningserver.boot import ( |
611 | +from maascluster.boot import ( |
612 | BootMethod, |
613 | BootMethodInstallError, |
614 | utils, |
615 | ) |
616 | -from provisioningserver.boot.install_bootloader import install_bootloader |
617 | -from provisioningserver.utils.fs import tempdir |
618 | -from provisioningserver.utils.shell import call_and_check |
619 | +from maascluster.boot.install_bootloader import install_bootloader |
620 | +from maascluster.utils.fs import tempdir |
621 | +from maascluster.utils.shell import call_and_check |
622 | |
623 | |
624 | GRUB_CONFIG = dedent("""\ |
625 | |
626 | === modified file 'src/maascluster/boot/powernv.py' |
627 | --- src/provisioningserver/boot/powernv.py 2015-03-25 15:33:23 +0000 |
628 | +++ src/maascluster/boot/powernv.py 2015-05-01 07:23:47 +0000 |
629 | @@ -18,17 +18,17 @@ |
630 | |
631 | import re |
632 | |
633 | -from provisioningserver.boot import ( |
634 | +from maascluster.boot import ( |
635 | BootMethod, |
636 | BytesReader, |
637 | get_parameters, |
638 | get_remote_mac, |
639 | ) |
640 | -from provisioningserver.boot.pxe import ( |
641 | +from maascluster.boot.pxe import ( |
642 | ARP_HTYPE, |
643 | re_mac_address, |
644 | ) |
645 | -from provisioningserver.kernel_opts import compose_kernel_command_line |
646 | +from maascluster.kernel_opts import compose_kernel_command_line |
647 | from tftp.backend import FilesystemReader |
648 | |
649 | # The pxelinux.cfg path is prefixed with the architecture for the |
650 | |
651 | === modified file 'src/maascluster/boot/pxe.py' |
652 | --- src/provisioningserver/boot/pxe.py 2015-03-25 15:33:23 +0000 |
653 | +++ src/maascluster/boot/pxe.py 2015-05-01 07:23:47 +0000 |
654 | @@ -20,13 +20,13 @@ |
655 | import os.path |
656 | import re |
657 | |
658 | -from provisioningserver.boot import ( |
659 | +from maascluster.boot import ( |
660 | BootMethod, |
661 | BytesReader, |
662 | get_parameters, |
663 | ) |
664 | -from provisioningserver.boot.install_bootloader import install_bootloader |
665 | -from provisioningserver.utils.fs import atomic_symlink |
666 | +from maascluster.boot.install_bootloader import install_bootloader |
667 | +from maascluster.utils.fs import atomic_symlink |
668 | |
669 | # Bootloader file names to install. |
670 | BOOTLOADERS = ['pxelinux.0', 'chain.c32', 'ifcpu64.c32'] |
671 | |
672 | === modified file 'src/maascluster/boot/tests/test_boot.py' |
673 | --- src/provisioningserver/boot/tests/test_boot.py 2015-03-25 15:33:23 +0000 |
674 | +++ src/maascluster/boot/tests/test_boot.py 2015-05-01 07:23:47 +0000 |
675 | @@ -1,7 +1,7 @@ |
676 | # Copyright 2012-2014 Canonical Ltd. This software is licensed under the |
677 | # GNU Affero General Public License version 3 (see the file LICENSE). |
678 | |
679 | -"""Tests for `provisioningserver.boot`.""" |
680 | +"""Tests for `maascluster.boot`.""" |
681 | |
682 | from __future__ import ( |
683 | absolute_import, |
684 | @@ -18,6 +18,13 @@ |
685 | import os |
686 | |
687 | from fixtures import EnvironmentVariableFixture |
688 | +from maascluster import boot |
689 | +from maascluster.boot import ( |
690 | + BootMethod, |
691 | + BytesReader, |
692 | + gen_template_filenames, |
693 | + get_remote_mac, |
694 | +) |
695 | from maastesting.factory import factory |
696 | from maastesting.matchers import MockCalledOnceWith |
697 | from maastesting.testcase import ( |
698 | @@ -25,13 +32,6 @@ |
699 | MAASTwistedRunTest, |
700 | ) |
701 | import mock |
702 | -from provisioningserver import boot |
703 | -from provisioningserver.boot import ( |
704 | - BootMethod, |
705 | - BytesReader, |
706 | - gen_template_filenames, |
707 | - get_remote_mac, |
708 | -) |
709 | import tempita |
710 | from twisted.internet.defer import inlineCallbacks |
711 | from twisted.python import context |
712 | @@ -55,7 +55,7 @@ |
713 | |
714 | |
715 | class TestBootMethod(MAASTestCase): |
716 | - """Test for `BootMethod` in `provisioningserver.boot`.""" |
717 | + """Test for `BootMethod` in `maascluster.boot`.""" |
718 | |
719 | run_tests_with = MAASTwistedRunTest.make_factory(timeout=5) |
720 | |
721 | |
722 | === modified file 'src/maascluster/boot/tests/test_install_bootloader.py' |
723 | --- src/provisioningserver/boot/tests/test_install_bootloader.py 2015-03-25 15:33:23 +0000 |
724 | +++ src/maascluster/boot/tests/test_install_bootloader.py 2015-05-01 07:23:47 +0000 |
725 | @@ -16,16 +16,16 @@ |
726 | |
727 | import os.path |
728 | |
729 | +from maascluster.boot.install_bootloader import ( |
730 | + install_bootloader, |
731 | + make_destination, |
732 | +) |
733 | from maastesting.factory import factory |
734 | from maastesting.testcase import MAASTestCase |
735 | from maastesting.utils import ( |
736 | age_file, |
737 | get_write_time, |
738 | ) |
739 | -from provisioningserver.boot.install_bootloader import ( |
740 | - install_bootloader, |
741 | - make_destination, |
742 | -) |
743 | from testtools.matchers import ( |
744 | DirExists, |
745 | FileContains, |
746 | |
747 | === modified file 'src/maascluster/boot/tests/test_install_grub.py' |
748 | --- src/provisioningserver/boot/tests/test_install_grub.py 2014-08-13 21:49:35 +0000 |
749 | +++ src/maascluster/boot/tests/test_install_grub.py 2015-05-01 07:23:47 +0000 |
750 | @@ -16,12 +16,12 @@ |
751 | |
752 | import os.path |
753 | |
754 | +import maascluster.boot.install_grub |
755 | +from maascluster.boot.tftppath import locate_tftp_path |
756 | +from maascluster.testing.config import set_tftp_root |
757 | +from maascluster.utils.script import MainScript |
758 | from maastesting.factory import factory |
759 | from maastesting.testcase import MAASTestCase |
760 | -import provisioningserver.boot.install_grub |
761 | -from provisioningserver.boot.tftppath import locate_tftp_path |
762 | -from provisioningserver.testing.config import set_tftp_root |
763 | -from provisioningserver.utils.script import MainScript |
764 | from testtools.matchers import FileExists |
765 | |
766 | |
767 | @@ -33,7 +33,7 @@ |
768 | |
769 | action = factory.make_name("action") |
770 | script = MainScript(action) |
771 | - script.register(action, provisioningserver.boot.install_grub) |
772 | + script.register(action, maascluster.boot.install_grub) |
773 | script.execute( |
774 | ("--config-file", config_fixture.filename, action)) |
775 | |
776 | |
777 | === modified file 'src/maascluster/boot/tests/test_powerkvm.py' |
778 | --- src/provisioningserver/boot/tests/test_powerkvm.py 2015-03-25 15:33:23 +0000 |
779 | +++ src/maascluster/boot/tests/test_powerkvm.py 2015-05-01 07:23:47 +0000 |
780 | @@ -1,7 +1,7 @@ |
781 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
782 | # GNU Affero General Public License version 3 (see the file LICENSE). |
783 | |
784 | -"""Tests for `provisioningserver.boot.powerkvm`.""" |
785 | +"""Tests for `maascluster.boot.powerkvm`.""" |
786 | |
787 | from __future__ import ( |
788 | absolute_import, |
789 | @@ -17,23 +17,23 @@ |
790 | from contextlib import contextmanager |
791 | import os |
792 | |
793 | -from maastesting.factory import factory |
794 | -from maastesting.matchers import MockCalledOnceWith |
795 | -from maastesting.testcase import MAASTestCase |
796 | -from provisioningserver.boot import ( |
797 | +from maascluster.boot import ( |
798 | BootMethodInstallError, |
799 | powerkvm as powerkvm_module, |
800 | utils, |
801 | ) |
802 | -from provisioningserver.boot.powerkvm import ( |
803 | +from maascluster.boot.powerkvm import ( |
804 | GRUB_CONFIG, |
805 | PowerKVMBootMethod, |
806 | ) |
807 | -from provisioningserver.tests.test_kernel_opts import make_kernel_parameters |
808 | +from maascluster.tests.test_kernel_opts import make_kernel_parameters |
809 | +from maastesting.factory import factory |
810 | +from maastesting.matchers import MockCalledOnceWith |
811 | +from maastesting.testcase import MAASTestCase |
812 | |
813 | |
814 | class TestPowerKVMBootMethod(MAASTestCase): |
815 | - """Tests `provisioningserver.boot.powerkvm.PowerKVMBootMethod`.""" |
816 | + """Tests `maascluster.boot.powerkvm.PowerKVMBootMethod`.""" |
817 | |
818 | def test_match_path_returns_None(self): |
819 | method = PowerKVMBootMethod() |
820 | |
821 | === modified file 'src/maascluster/boot/tests/test_powernv.py' |
822 | --- src/provisioningserver/boot/tests/test_powernv.py 2015-03-25 15:33:23 +0000 |
823 | +++ src/maascluster/boot/tests/test_powernv.py 2015-05-01 07:23:47 +0000 |
824 | @@ -1,7 +1,7 @@ |
825 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
826 | # GNU Affero General Public License version 3 (see the file LICENSE). |
827 | |
828 | -"""Tests for `provisioningserver.boot.powernv`.""" |
829 | +"""Tests for `maascluster.boot.powernv`.""" |
830 | |
831 | from __future__ import ( |
832 | absolute_import, |
833 | @@ -17,23 +17,23 @@ |
834 | import os |
835 | import re |
836 | |
837 | -from maastesting.factory import factory |
838 | -from maastesting.testcase import MAASTestCase |
839 | -from provisioningserver.boot import ( |
840 | +from maascluster.boot import ( |
841 | BytesReader, |
842 | powernv as powernv_module, |
843 | ) |
844 | -from provisioningserver.boot.powernv import ( |
845 | +from maascluster.boot.powernv import ( |
846 | ARP_HTYPE, |
847 | format_bootif, |
848 | PowerNVBootMethod, |
849 | re_config_file, |
850 | ) |
851 | -from provisioningserver.boot.tests.test_pxe import parse_pxe_config |
852 | -from provisioningserver.boot.tftppath import compose_image_path |
853 | -from provisioningserver.pserv_services.tftp import TFTPBackend |
854 | -from provisioningserver.testing.config import set_tftp_root |
855 | -from provisioningserver.tests.test_kernel_opts import make_kernel_parameters |
856 | +from maascluster.boot.tests.test_pxe import parse_pxe_config |
857 | +from maascluster.boot.tftppath import compose_image_path |
858 | +from maascluster.pserv_services.tftp import TFTPBackend |
859 | +from maascluster.testing.config import set_tftp_root |
860 | +from maascluster.tests.test_kernel_opts import make_kernel_parameters |
861 | +from maastesting.factory import factory |
862 | +from maastesting.testcase import MAASTestCase |
863 | from testtools.matchers import ( |
864 | IsInstance, |
865 | MatchesAll, |
866 | @@ -124,7 +124,7 @@ |
867 | |
868 | class TestPowerNVBootMethodMatchPath(MAASTestCase): |
869 | """Tests for |
870 | - `provisioningserver.boot.powernv.PowerNVBootMethod.match_path`. |
871 | + `maascluster.boot.powernv.PowerNVBootMethod.match_path`. |
872 | """ |
873 | |
874 | def test_match_path_pxe_config_with_mac(self): |
875 | @@ -162,7 +162,7 @@ |
876 | |
877 | class TestPowerNVBootMethodRenderConfig(MAASTestCase): |
878 | """Tests for |
879 | - `provisioningserver.boot.powernv.PowerNVBootMethod.get_reader` |
880 | + `maascluster.boot.powernv.PowerNVBootMethod.get_reader` |
881 | """ |
882 | |
883 | def test_get_reader_install(self): |
884 | @@ -248,7 +248,7 @@ |
885 | |
886 | class TestPowerNVBootMethodPathPrefix(MAASTestCase): |
887 | """Tests for |
888 | - `provisioningserver.boot.powernv.PowerNVBootMethod.get_reader`. |
889 | + `maascluster.boot.powernv.PowerNVBootMethod.get_reader`. |
890 | """ |
891 | |
892 | def test_get_reader_path_prefix(self): |
893 | @@ -290,7 +290,7 @@ |
894 | |
895 | class TestPowerNVBootMethodRegex(MAASTestCase): |
896 | """Tests for |
897 | - `provisioningserver.boot.powernv.PowerNVBootMethod.re_config_file`. |
898 | + `maascluster.boot.powernv.PowerNVBootMethod.re_config_file`. |
899 | """ |
900 | |
901 | def test_re_config_file_is_compatible_with_config_path_generator(self): |
902 | |
903 | === modified file 'src/maascluster/boot/tests/test_pxe.py' |
904 | --- src/provisioningserver/boot/tests/test_pxe.py 2015-03-25 15:33:23 +0000 |
905 | +++ src/maascluster/boot/tests/test_pxe.py 2015-05-01 07:23:47 +0000 |
906 | @@ -18,24 +18,24 @@ |
907 | import os |
908 | import re |
909 | |
910 | -from maastesting.factory import factory |
911 | -from maastesting.matchers import MockCallsMatch |
912 | -from maastesting.testcase import MAASTestCase |
913 | -import mock |
914 | -from provisioningserver import kernel_opts |
915 | -from provisioningserver.boot import ( |
916 | +from maascluster import kernel_opts |
917 | +from maascluster.boot import ( |
918 | BytesReader, |
919 | pxe as pxe_module, |
920 | ) |
921 | -from provisioningserver.boot.pxe import ( |
922 | +from maascluster.boot.pxe import ( |
923 | ARP_HTYPE, |
924 | BOOTLOADERS, |
925 | PXEBootMethod, |
926 | re_config_file, |
927 | ) |
928 | -from provisioningserver.boot.tftppath import compose_image_path |
929 | -from provisioningserver.testing.config import set_tftp_root |
930 | -from provisioningserver.tests.test_kernel_opts import make_kernel_parameters |
931 | +from maascluster.boot.tftppath import compose_image_path |
932 | +from maascluster.testing.config import set_tftp_root |
933 | +from maascluster.tests.test_kernel_opts import make_kernel_parameters |
934 | +from maastesting.factory import factory |
935 | +from maastesting.matchers import MockCallsMatch |
936 | +from maastesting.testcase import MAASTestCase |
937 | +import mock |
938 | from testtools.matchers import ( |
939 | Contains, |
940 | ContainsAll, |
941 | @@ -229,7 +229,7 @@ |
942 | |
943 | |
944 | class TestPXEBootMethodRender(MAASTestCase): |
945 | - """Tests for `provisioningserver.boot.pxe.PXEBootMethod.render`.""" |
946 | + """Tests for `maascluster.boot.pxe.PXEBootMethod.render`.""" |
947 | |
948 | def test_get_reader_install(self): |
949 | # Given the right configuration options, the PXE configuration is |
950 | @@ -384,7 +384,7 @@ |
951 | |
952 | |
953 | class TestPXEBootMethodRenderConfigScenarios(MAASTestCase): |
954 | - """Tests for `provisioningserver.boot.pxe.PXEBootMethod.render_config`.""" |
955 | + """Tests for `maascluster.boot.pxe.PXEBootMethod.render_config`.""" |
956 | |
957 | scenarios = [ |
958 | ("commissioning", dict(purpose="commissioning")), |
959 | @@ -461,7 +461,7 @@ |
960 | |
961 | |
962 | class TestPXEBootMethodRegex(MAASTestCase): |
963 | - """Tests for `provisioningserver.boot.pxe.PXEBootMethod.re_config_file`.""" |
964 | + """Tests for `maascluster.boot.pxe.PXEBootMethod.re_config_file`.""" |
965 | |
966 | @staticmethod |
967 | def get_example_path_and_components(): |
968 | |
969 | === modified file 'src/maascluster/boot/tests/test_tftppath.py' |
970 | --- src/provisioningserver/boot/tests/test_tftppath.py 2015-03-25 15:33:23 +0000 |
971 | +++ src/maascluster/boot/tests/test_tftppath.py 2015-05-01 07:23:47 +0000 |
972 | @@ -17,13 +17,9 @@ |
973 | import errno |
974 | import os.path |
975 | |
976 | -from maastesting.factory import factory |
977 | -from maastesting.matchers import MockCalledOnceWith |
978 | -from maastesting.testcase import MAASTestCase |
979 | -from mock import Mock |
980 | -from provisioningserver import config |
981 | -from provisioningserver.boot import tftppath |
982 | -from provisioningserver.boot.tftppath import ( |
983 | +from maascluster import config |
984 | +from maascluster.boot import tftppath |
985 | +from maascluster.boot.tftppath import ( |
986 | compose_image_path, |
987 | drill_down, |
988 | extend_path, |
989 | @@ -35,21 +31,23 @@ |
990 | locate_tftp_path, |
991 | maas_meta_last_modified, |
992 | ) |
993 | -from provisioningserver.drivers.osystem import OperatingSystemRegistry |
994 | -from provisioningserver.import_images.boot_image_mapping import ( |
995 | - BootImageMapping, |
996 | -) |
997 | -from provisioningserver.import_images.helpers import ImageSpec |
998 | -from provisioningserver.import_images.testing.factory import ( |
999 | +from maascluster.drivers.osystem import OperatingSystemRegistry |
1000 | +from maascluster.import_images.boot_image_mapping import BootImageMapping |
1001 | +from maascluster.import_images.helpers import ImageSpec |
1002 | +from maascluster.import_images.testing.factory import ( |
1003 | make_image_spec, |
1004 | set_resource, |
1005 | ) |
1006 | -from provisioningserver.testing.boot_images import ( |
1007 | +from maascluster.testing.boot_images import ( |
1008 | make_boot_image_storage_params, |
1009 | make_image, |
1010 | ) |
1011 | -from provisioningserver.testing.config import set_tftp_root |
1012 | -from provisioningserver.testing.os import make_osystem |
1013 | +from maascluster.testing.config import set_tftp_root |
1014 | +from maascluster.testing.os import make_osystem |
1015 | +from maastesting.factory import factory |
1016 | +from maastesting.matchers import MockCalledOnceWith |
1017 | +from maastesting.testcase import MAASTestCase |
1018 | +from mock import Mock |
1019 | from testtools.matchers import ( |
1020 | Not, |
1021 | StartsWith, |
1022 | |
1023 | === modified file 'src/maascluster/boot/tests/test_uefi.py' |
1024 | --- src/provisioningserver/boot/tests/test_uefi.py 2015-03-25 15:33:23 +0000 |
1025 | +++ src/maascluster/boot/tests/test_uefi.py 2015-05-01 07:23:47 +0000 |
1026 | @@ -1,7 +1,7 @@ |
1027 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
1028 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1029 | |
1030 | -"""Tests for `provisioningserver.boot.uefi`.""" |
1031 | +"""Tests for `maascluster.boot.uefi`.""" |
1032 | |
1033 | from __future__ import ( |
1034 | absolute_import, |
1035 | @@ -17,21 +17,21 @@ |
1036 | import re |
1037 | from urlparse import urlparse |
1038 | |
1039 | +from maascluster.boot import BytesReader |
1040 | +from maascluster.boot.tftppath import compose_image_path |
1041 | +from maascluster.boot.uefi import ( |
1042 | + get_main_archive_url, |
1043 | + re_config_file, |
1044 | + UEFIBootMethod, |
1045 | +) |
1046 | +from maascluster.rpc import region |
1047 | +from maascluster.rpc.testing import MockLiveClusterToRegionRPCFixture |
1048 | +from maascluster.tests.test_kernel_opts import make_kernel_parameters |
1049 | from maastesting.factory import factory |
1050 | from maastesting.testcase import ( |
1051 | MAASTestCase, |
1052 | MAASTwistedRunTest, |
1053 | ) |
1054 | -from provisioningserver.boot import BytesReader |
1055 | -from provisioningserver.boot.tftppath import compose_image_path |
1056 | -from provisioningserver.boot.uefi import ( |
1057 | - get_main_archive_url, |
1058 | - re_config_file, |
1059 | - UEFIBootMethod, |
1060 | -) |
1061 | -from provisioningserver.rpc import region |
1062 | -from provisioningserver.rpc.testing import MockLiveClusterToRegionRPCFixture |
1063 | -from provisioningserver.tests.test_kernel_opts import make_kernel_parameters |
1064 | from testtools.matchers import ( |
1065 | ContainsAll, |
1066 | IsInstance, |
1067 | @@ -95,7 +95,7 @@ |
1068 | |
1069 | |
1070 | class TestUEFIBootMethodRender(MAASTestCase): |
1071 | - """Tests for `provisioningserver.boot.uefi.UEFIBootMethod.render`.""" |
1072 | + """Tests for `maascluster.boot.uefi.UEFIBootMethod.render`.""" |
1073 | |
1074 | def test_get_reader(self): |
1075 | # Given the right configuration options, the UEFI configuration is |
1076 | @@ -191,7 +191,7 @@ |
1077 | |
1078 | |
1079 | class TestUEFIBootMethodRegex(MAASTestCase): |
1080 | - """Tests `provisioningserver.boot.uefi.UEFIBootMethod.re_config_file`.""" |
1081 | + """Tests `maascluster.boot.uefi.UEFIBootMethod.re_config_file`.""" |
1082 | |
1083 | @staticmethod |
1084 | def get_example_path_and_components(): |
1085 | |
1086 | === modified file 'src/maascluster/boot/tests/test_utils.py' |
1087 | --- src/provisioningserver/boot/tests/test_utils.py 2015-03-25 15:33:23 +0000 |
1088 | +++ src/maascluster/boot/tests/test_utils.py 2015-05-01 07:23:47 +0000 |
1089 | @@ -1,7 +1,7 @@ |
1090 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
1091 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1092 | |
1093 | -"""Tests for `provisioningserver.boot.utils`.""" |
1094 | +"""Tests for `maascluster.boot.utils`.""" |
1095 | |
1096 | from __future__ import ( |
1097 | absolute_import, |
1098 | @@ -14,6 +14,7 @@ |
1099 | __metaclass__ = type |
1100 | __all__ = [] |
1101 | |
1102 | +from maascluster.boot import utils |
1103 | from maastesting.factory import factory |
1104 | from maastesting.matchers import ( |
1105 | MockCalledOnceWith, |
1106 | @@ -21,11 +22,10 @@ |
1107 | ) |
1108 | from maastesting.testcase import MAASTestCase |
1109 | from mock import call |
1110 | -from provisioningserver.boot import utils |
1111 | |
1112 | |
1113 | class TestBootMethodUtils(MAASTestCase): |
1114 | - """Test for `BootMethod` in `provisioningserver.boot.utils`.""" |
1115 | + """Test for `BootMethod` in `maascluster.boot.utils`.""" |
1116 | |
1117 | def test_get_packages(self): |
1118 | archive = factory.make_name("archive") |
1119 | |
1120 | === modified file 'src/maascluster/boot/tests/test_windows.py' |
1121 | --- src/provisioningserver/boot/tests/test_windows.py 2015-03-25 15:33:23 +0000 |
1122 | +++ src/maascluster/boot/tests/test_windows.py 2015-05-01 07:23:47 +0000 |
1123 | @@ -2,7 +2,7 @@ |
1124 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
1125 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1126 | |
1127 | -"""Tests for `provisioningserver.boot.windows`.""" |
1128 | +"""Tests for `maascluster.boot.windows`.""" |
1129 | |
1130 | from __future__ import ( |
1131 | absolute_import, |
1132 | @@ -20,6 +20,23 @@ |
1133 | import shutil |
1134 | |
1135 | from fixtures import FakeLogger |
1136 | +from maascluster.boot import ( |
1137 | + BootMethodError, |
1138 | + BytesReader, |
1139 | + windows as windows_module, |
1140 | +) |
1141 | +from maascluster.boot.windows import ( |
1142 | + Bcd, |
1143 | + WindowsPXEBootMethod, |
1144 | +) |
1145 | +from maascluster.config import Config |
1146 | +from maascluster.rpc.exceptions import NoSuchNode |
1147 | +from maascluster.rpc.region import RequestNodeInfoByMACAddress |
1148 | +from maascluster.rpc.testing import ( |
1149 | + always_fail_with, |
1150 | + always_succeed_with, |
1151 | +) |
1152 | +from maascluster.tests.test_kernel_opts import make_kernel_parameters |
1153 | from maastesting.factory import factory |
1154 | from maastesting.matchers import MockCalledOnceWith |
1155 | from maastesting.testcase import ( |
1156 | @@ -28,23 +45,6 @@ |
1157 | ) |
1158 | import mock |
1159 | from mock import sentinel |
1160 | -from provisioningserver.boot import ( |
1161 | - BootMethodError, |
1162 | - BytesReader, |
1163 | - windows as windows_module, |
1164 | -) |
1165 | -from provisioningserver.boot.windows import ( |
1166 | - Bcd, |
1167 | - WindowsPXEBootMethod, |
1168 | -) |
1169 | -from provisioningserver.config import Config |
1170 | -from provisioningserver.rpc.exceptions import NoSuchNode |
1171 | -from provisioningserver.rpc.region import RequestNodeInfoByMACAddress |
1172 | -from provisioningserver.rpc.testing import ( |
1173 | - always_fail_with, |
1174 | - always_succeed_with, |
1175 | -) |
1176 | -from provisioningserver.tests.test_kernel_opts import make_kernel_parameters |
1177 | from testtools.deferredruntest import extract_result |
1178 | from testtools.matchers import Is |
1179 | from tftp.backend import FilesystemReader |
1180 | @@ -355,7 +355,7 @@ |
1181 | self.patch(windows_module, 'Bcd') |
1182 | |
1183 | with mock.patch( |
1184 | - 'provisioningserver.boot.windows.open', |
1185 | + 'maascluster.boot.windows.open', |
1186 | mock.mock_open(read_data=fake_output), create=True): |
1187 | output = method.compose_bcd(kernel_params, local_host) |
1188 | |
1189 | |
1190 | === modified file 'src/maascluster/boot/tftppath.py' |
1191 | --- src/provisioningserver/boot/tftppath.py 2015-03-25 15:33:23 +0000 |
1192 | +++ src/maascluster/boot/tftppath.py 2015-05-01 07:23:47 +0000 |
1193 | @@ -23,16 +23,14 @@ |
1194 | from itertools import chain |
1195 | import os.path |
1196 | |
1197 | -from provisioningserver import config |
1198 | -from provisioningserver.drivers.osystem import ( |
1199 | +from maascluster import config |
1200 | +from maascluster.drivers.osystem import ( |
1201 | BOOT_IMAGE_PURPOSE, |
1202 | OperatingSystemRegistry, |
1203 | ) |
1204 | -from provisioningserver.import_images.boot_image_mapping import ( |
1205 | - BootImageMapping, |
1206 | -) |
1207 | -from provisioningserver.import_images.helpers import ImageSpec |
1208 | -from provisioningserver.logger import get_maas_logger |
1209 | +from maascluster.import_images.boot_image_mapping import BootImageMapping |
1210 | +from maascluster.import_images.helpers import ImageSpec |
1211 | +from maascluster.logger import get_maas_logger |
1212 | |
1213 | |
1214 | maaslog = get_maas_logger("tftp") |
1215 | @@ -206,7 +204,7 @@ |
1216 | or None if the file doesn't exist. |
1217 | |
1218 | :param tftproot: Optional tftp root dir, defaults to |
1219 | - provisioningserver.config.BOOT_RESOURCES_STORAGE |
1220 | + maascluster.config.BOOT_RESOURCES_STORAGE |
1221 | """ |
1222 | if tftproot is None: |
1223 | tftproot = os.path.join(config.BOOT_RESOURCES_STORAGE, 'current') |
1224 | |
1225 | === modified file 'src/maascluster/boot/uefi.py' |
1226 | --- src/provisioningserver/boot/uefi.py 2015-03-25 15:33:23 +0000 |
1227 | +++ src/maascluster/boot/uefi.py 2015-05-01 07:23:47 +0000 |
1228 | @@ -23,22 +23,22 @@ |
1229 | import urllib2 |
1230 | from urlparse import urljoin |
1231 | |
1232 | -from provisioningserver.boot import ( |
1233 | +from maascluster.boot import ( |
1234 | BootMethod, |
1235 | BootMethodInstallError, |
1236 | BytesReader, |
1237 | get_parameters, |
1238 | utils, |
1239 | ) |
1240 | -from provisioningserver.boot.install_bootloader import ( |
1241 | +from maascluster.boot.install_bootloader import ( |
1242 | install_bootloader, |
1243 | make_destination, |
1244 | ) |
1245 | -from provisioningserver.rpc import getRegionClient |
1246 | -from provisioningserver.rpc.region import GetArchiveMirrors |
1247 | -from provisioningserver.utils.fs import tempdir |
1248 | -from provisioningserver.utils.shell import call_and_check |
1249 | -from provisioningserver.utils.twisted import asynchronous |
1250 | +from maascluster.rpc import getRegionClient |
1251 | +from maascluster.rpc.region import GetArchiveMirrors |
1252 | +from maascluster.utils.fs import tempdir |
1253 | +from maascluster.utils.shell import call_and_check |
1254 | +from maascluster.utils.twisted import asynchronous |
1255 | from twisted.internet.defer import ( |
1256 | inlineCallbacks, |
1257 | returnValue, |
1258 | |
1259 | === modified file 'src/maascluster/boot/utils.py' |
1260 | --- src/provisioningserver/boot/utils.py 2014-11-17 11:56:49 +0000 |
1261 | +++ src/maascluster/boot/utils.py 2015-05-01 07:23:47 +0000 |
1262 | @@ -26,8 +26,8 @@ |
1263 | import StringIO |
1264 | import urllib2 |
1265 | |
1266 | -from provisioningserver.utils.fs import tempdir |
1267 | -from provisioningserver.utils.shell import call_and_check |
1268 | +from maascluster.utils.fs import tempdir |
1269 | +from maascluster.utils.shell import call_and_check |
1270 | |
1271 | |
1272 | def urljoin(*args): |
1273 | |
1274 | === modified file 'src/maascluster/boot/windows.py' |
1275 | --- src/provisioningserver/boot/windows.py 2015-03-25 15:33:23 +0000 |
1276 | +++ src/maascluster/boot/windows.py 2015-05-01 07:23:47 +0000 |
1277 | @@ -22,20 +22,20 @@ |
1278 | import shutil |
1279 | import sys |
1280 | |
1281 | -from provisioningserver.boot import ( |
1282 | +from maascluster.boot import ( |
1283 | BootMethod, |
1284 | BootMethodError, |
1285 | BytesReader, |
1286 | get_remote_mac, |
1287 | ) |
1288 | -from provisioningserver.config import Config |
1289 | -from provisioningserver.logger.log import get_maas_logger |
1290 | -from provisioningserver.rpc import getRegionClient |
1291 | -from provisioningserver.rpc.exceptions import NoSuchNode |
1292 | -from provisioningserver.rpc.region import RequestNodeInfoByMACAddress |
1293 | -from provisioningserver.utils import tftp |
1294 | -from provisioningserver.utils.fs import tempdir |
1295 | -from provisioningserver.utils.twisted import ( |
1296 | +from maascluster.config import Config |
1297 | +from maascluster.logger.log import get_maas_logger |
1298 | +from maascluster.rpc import getRegionClient |
1299 | +from maascluster.rpc.exceptions import NoSuchNode |
1300 | +from maascluster.rpc.region import RequestNodeInfoByMACAddress |
1301 | +from maascluster.utils import tftp |
1302 | +from maascluster.utils.fs import tempdir |
1303 | +from maascluster.utils.twisted import ( |
1304 | asynchronous, |
1305 | deferred, |
1306 | ) |
1307 | |
1308 | === modified file 'src/maascluster/cluster_config.py' |
1309 | --- src/provisioningserver/cluster_config.py 2015-04-02 18:44:12 +0000 |
1310 | +++ src/maascluster/cluster_config.py 2015-05-01 07:23:47 +0000 |
1311 | @@ -21,7 +21,7 @@ |
1312 | |
1313 | from os import environ |
1314 | |
1315 | -from provisioningserver.config import ClusterConfiguration |
1316 | +from maascluster.config import ClusterConfiguration |
1317 | |
1318 | # List of configuration keys |
1319 | |
1320 | |
1321 | === modified file 'src/maascluster/cluster_config_command.py' |
1322 | --- src/provisioningserver/cluster_config_command.py 2015-04-02 19:30:23 +0000 |
1323 | +++ src/maascluster/cluster_config_command.py 2015-05-01 07:23:47 +0000 |
1324 | @@ -21,12 +21,12 @@ |
1325 | |
1326 | from uuid import uuid4 |
1327 | |
1328 | -from provisioningserver.cluster_config import ( |
1329 | +from maascluster.cluster_config import ( |
1330 | CLUSTER_CONFIG, |
1331 | get_config_cluster_variable, |
1332 | set_config_cluster_variable, |
1333 | ) |
1334 | -from provisioningserver.config import UUID_NOT_SET |
1335 | +from maascluster.config import UUID_NOT_SET |
1336 | |
1337 | |
1338 | def update_maas_cluster_conf( |
1339 | |
1340 | === modified file 'src/maascluster/config.py' |
1341 | --- src/provisioningserver/config.py 2015-04-04 00:40:18 +0000 |
1342 | +++ src/maascluster/config.py 2015-05-01 07:23:47 +0000 |
1343 | @@ -6,7 +6,7 @@ |
1344 | Configuration for most elements of a Cluster Controller can be obtained |
1345 | through this module's `Config` validator class. At the time of writing the |
1346 | exceptions are the `CLUSTER_UUID` and `MAAS_URL` environment variables (see |
1347 | -`provisioningserver.cluster_config`). |
1348 | +`maascluster.cluster_config`). |
1349 | |
1350 | It's pretty simple. Typical usage is:: |
1351 | |
1352 | @@ -37,7 +37,7 @@ |
1353 | filename. To revert to the default - i.e. erase the environment variable - you |
1354 | can `del Config.DEFAULT_FILENAME`. |
1355 | |
1356 | -When testing, see `provisioningserver.testing.config.ConfigFixture` to |
1357 | +When testing, see `maascluster.testing.config.ConfigFixture` to |
1358 | temporarily use a different configuration. |
1359 | |
1360 | """ |
1361 | @@ -92,8 +92,8 @@ |
1362 | UnicodeString, |
1363 | URL, |
1364 | ) |
1365 | -from provisioningserver.path import get_tentative_path |
1366 | -from provisioningserver.utils.fs import ( |
1367 | +from maascluster.path import get_tentative_path |
1368 | +from maascluster.utils.fs import ( |
1369 | atomic_write, |
1370 | ensure_dir, |
1371 | FileLockProxy, |
1372 | @@ -381,7 +381,7 @@ |
1373 | |
1374 | def _get_default_filename(cls): |
1375 | # Avoid circular imports. |
1376 | - from provisioningserver.utils import locate_config |
1377 | + from maascluster.utils import locate_config |
1378 | |
1379 | # Get the configuration filename from the environment. Failing that, |
1380 | # look for the configuration in its default locations. |
1381 | |
1382 | === modified file 'src/maascluster/configure_maas_url.py' |
1383 | --- src/provisioningserver/configure_maas_url.py 2015-03-25 15:33:23 +0000 |
1384 | +++ src/maascluster/configure_maas_url.py 2015-05-01 07:23:47 +0000 |
1385 | @@ -26,11 +26,11 @@ |
1386 | import re |
1387 | from urlparse import urlparse |
1388 | |
1389 | -from provisioningserver.utils.fs import ( |
1390 | +from maascluster.utils.fs import ( |
1391 | atomic_write, |
1392 | read_text_file, |
1393 | ) |
1394 | -from provisioningserver.utils.url import compose_URL |
1395 | +from maascluster.utils.url import compose_URL |
1396 | |
1397 | |
1398 | MAAS_CLUSTER_CONF = '/etc/maas/maas_cluster.conf' |
1399 | |
1400 | === modified file 'src/maascluster/customize_config.py' |
1401 | --- src/provisioningserver/customize_config.py 2013-10-07 09:12:40 +0000 |
1402 | +++ src/maascluster/customize_config.py 2015-05-01 07:23:47 +0000 |
1403 | @@ -24,7 +24,7 @@ |
1404 | |
1405 | import sys |
1406 | |
1407 | -from provisioningserver.utils import write_custom_config_section |
1408 | +from maascluster.utils import write_custom_config_section |
1409 | |
1410 | |
1411 | def add_arguments(parser): |
1412 | |
1413 | === modified file 'src/maascluster/dhcp/config.py' |
1414 | --- src/provisioningserver/dhcp/config.py 2015-03-25 15:33:23 +0000 |
1415 | +++ src/maascluster/dhcp/config.py 2015-05-01 07:23:47 +0000 |
1416 | @@ -24,8 +24,8 @@ |
1417 | ) |
1418 | from platform import linux_distribution |
1419 | |
1420 | -from provisioningserver.boot import BootMethodRegistry |
1421 | -from provisioningserver.utils import locate_config |
1422 | +from maascluster.boot import BootMethodRegistry |
1423 | +from maascluster.utils import locate_config |
1424 | import tempita |
1425 | |
1426 | # Location of DHCP templates, relative to the configuration directory. |
1427 | |
1428 | === modified file 'src/maascluster/dhcp/control.py' |
1429 | --- src/provisioningserver/dhcp/control.py 2015-03-25 15:33:23 +0000 |
1430 | +++ src/maascluster/dhcp/control.py 2015-05-01 07:23:47 +0000 |
1431 | @@ -19,8 +19,8 @@ |
1432 | 'stop_dhcpv6', |
1433 | ] |
1434 | |
1435 | -from provisioningserver.utils import in_develop_mode |
1436 | -from provisioningserver.utils.shell import ( |
1437 | +from maascluster.utils import in_develop_mode |
1438 | +from maascluster.utils.shell import ( |
1439 | call_and_check, |
1440 | ExternalProcessError, |
1441 | ) |
1442 | |
1443 | === modified file 'src/maascluster/dhcp/detect.py' |
1444 | --- src/provisioningserver/dhcp/detect.py 2015-03-25 15:33:23 +0000 |
1445 | +++ src/maascluster/dhcp/detect.py 2015-05-01 07:23:47 +0000 |
1446 | @@ -35,7 +35,7 @@ |
1447 | MAASDispatcher, |
1448 | MAASOAuth, |
1449 | ) |
1450 | -from provisioningserver.logger import get_maas_logger |
1451 | +from maascluster.logger import get_maas_logger |
1452 | |
1453 | |
1454 | maaslog = get_maas_logger("dhcp.detect") |
1455 | |
1456 | === modified file 'src/maascluster/dhcp/leases.py' |
1457 | --- src/provisioningserver/dhcp/leases.py 2015-03-25 15:33:23 +0000 |
1458 | +++ src/maascluster/dhcp/leases.py 2015-05-01 07:23:47 +0000 |
1459 | @@ -41,9 +41,9 @@ |
1460 | stat, |
1461 | ) |
1462 | |
1463 | -from provisioningserver.dhcp.leases_parser_fast import parse_leases |
1464 | -from provisioningserver.logger import get_maas_logger |
1465 | -from provisioningserver.utils.shell import objectfork |
1466 | +from maascluster.dhcp.leases_parser_fast import parse_leases |
1467 | +from maascluster.logger import get_maas_logger |
1468 | +from maascluster.utils.shell import objectfork |
1469 | |
1470 | |
1471 | maaslog = get_maas_logger("dhcp.leases") |
1472 | |
1473 | === modified file 'src/maascluster/dhcp/leases_parser_fast.py' |
1474 | --- src/provisioningserver/dhcp/leases_parser_fast.py 2015-03-25 15:33:23 +0000 |
1475 | +++ src/maascluster/dhcp/leases_parser_fast.py 2015-05-01 07:23:47 +0000 |
1476 | @@ -28,7 +28,7 @@ |
1477 | from itertools import chain |
1478 | import re |
1479 | |
1480 | -from provisioningserver.dhcp.leases_parser import ( |
1481 | +from maascluster.dhcp.leases_parser import ( |
1482 | get_host_mac, |
1483 | has_expired, |
1484 | is_host, |
1485 | |
1486 | === modified file 'src/maascluster/dhcp/omshell.py' |
1487 | --- src/provisioningserver/dhcp/omshell.py 2015-03-25 15:33:23 +0000 |
1488 | +++ src/maascluster/dhcp/omshell.py 2015-05-01 07:23:47 +0000 |
1489 | @@ -27,9 +27,9 @@ |
1490 | ) |
1491 | from textwrap import dedent |
1492 | |
1493 | -from provisioningserver.utils import parse_key_value_file |
1494 | -from provisioningserver.utils.fs import tempdir |
1495 | -from provisioningserver.utils.shell import ( |
1496 | +from maascluster.utils import parse_key_value_file |
1497 | +from maascluster.utils.fs import tempdir |
1498 | +from maascluster.utils.shell import ( |
1499 | call_and_check, |
1500 | ExternalProcessError, |
1501 | ) |
1502 | |
1503 | === modified file 'src/maascluster/dhcp/probe.py' |
1504 | --- src/provisioningserver/dhcp/probe.py 2014-01-05 21:27:58 +0000 |
1505 | +++ src/maascluster/dhcp/probe.py 2015-05-01 07:23:47 +0000 |
1506 | @@ -24,7 +24,7 @@ |
1507 | import argparse |
1508 | from sys import exit |
1509 | |
1510 | -from provisioningserver.dhcp.detect import probe_dhcp |
1511 | +from maascluster.dhcp.detect import probe_dhcp |
1512 | |
1513 | |
1514 | argument_parser = argparse.ArgumentParser(description=__doc__) |
1515 | |
1516 | === modified file 'src/maascluster/dhcp/tests/test_config.py' |
1517 | --- src/provisioningserver/dhcp/tests/test_config.py 2015-04-09 12:36:05 +0000 |
1518 | +++ src/maascluster/dhcp/tests/test_config.py 2015-05-01 07:23:47 +0000 |
1519 | @@ -21,11 +21,11 @@ |
1520 | from textwrap import dedent |
1521 | |
1522 | from fixtures import EnvironmentVariableFixture |
1523 | +from maascluster.boot import BootMethodRegistry |
1524 | +from maascluster.dhcp import config |
1525 | +from maascluster.dhcp.testing.config import make_subnet_config |
1526 | +from maascluster.testing.testcase import PservTestCase |
1527 | from maastesting.factory import factory |
1528 | -from provisioningserver.boot import BootMethodRegistry |
1529 | -from provisioningserver.dhcp import config |
1530 | -from provisioningserver.dhcp.testing.config import make_subnet_config |
1531 | -from provisioningserver.testing.testcase import PservTestCase |
1532 | import tempita |
1533 | from testtools.matchers import ( |
1534 | Contains, |
1535 | |
1536 | === modified file 'src/maascluster/dhcp/tests/test_control.py' |
1537 | --- src/provisioningserver/dhcp/tests/test_control.py 2015-03-25 15:33:23 +0000 |
1538 | +++ src/maascluster/dhcp/tests/test_control.py 2015-05-01 07:23:47 +0000 |
1539 | @@ -14,6 +14,16 @@ |
1540 | __metaclass__ = type |
1541 | __all__ = [] |
1542 | |
1543 | +from maascluster.dhcp import control |
1544 | +from maascluster.dhcp.control import ( |
1545 | + call_service_script, |
1546 | + restart_dhcpv4, |
1547 | + restart_dhcpv6, |
1548 | + stop_dhcp_server, |
1549 | + stop_dhcpv4, |
1550 | + stop_dhcpv6, |
1551 | +) |
1552 | +from maascluster.utils.shell import ExternalProcessError |
1553 | from maastesting.factory import factory |
1554 | from maastesting.matchers import ( |
1555 | MockCalledOnceWith, |
1556 | @@ -21,16 +31,6 @@ |
1557 | ) |
1558 | from maastesting.testcase import MAASTestCase |
1559 | from mock import ANY |
1560 | -from provisioningserver.dhcp import control |
1561 | -from provisioningserver.dhcp.control import ( |
1562 | - call_service_script, |
1563 | - restart_dhcpv4, |
1564 | - restart_dhcpv6, |
1565 | - stop_dhcp_server, |
1566 | - stop_dhcpv4, |
1567 | - stop_dhcpv6, |
1568 | -) |
1569 | -from provisioningserver.utils.shell import ExternalProcessError |
1570 | |
1571 | |
1572 | def patch_call_and_check(testcase): |
1573 | |
1574 | === modified file 'src/maascluster/dhcp/tests/test_detect.py' |
1575 | --- src/provisioningserver/dhcp/tests/test_detect.py 2015-03-25 15:33:23 +0000 |
1576 | +++ src/maascluster/dhcp/tests/test_detect.py 2015-05-01 07:23:47 +0000 |
1577 | @@ -27,11 +27,7 @@ |
1578 | EnvironmentVariable, |
1579 | FakeLogger, |
1580 | ) |
1581 | -from maastesting.factory import factory |
1582 | -from maastesting.matchers import MockCalledOnceWith |
1583 | -from maastesting.testcase import MAASTestCase |
1584 | -import mock |
1585 | -from provisioningserver.dhcp.detect import ( |
1586 | +from maascluster.dhcp.detect import ( |
1587 | BOOTP_CLIENT_PORT, |
1588 | BOOTP_SERVER_PORT, |
1589 | determine_cluster_interfaces, |
1590 | @@ -47,8 +43,12 @@ |
1591 | udp_socket, |
1592 | update_region_controller, |
1593 | ) |
1594 | -import provisioningserver.dhcp.detect as detect_module |
1595 | -from provisioningserver.testing.testcase import PservTestCase |
1596 | +import maascluster.dhcp.detect as detect_module |
1597 | +from maascluster.testing.testcase import PservTestCase |
1598 | +from maastesting.factory import factory |
1599 | +from maastesting.matchers import MockCalledOnceWith |
1600 | +from maastesting.testcase import MAASTestCase |
1601 | +import mock |
1602 | |
1603 | |
1604 | class MakeTransactionID(MAASTestCase): |
1605 | |
1606 | === modified file 'src/maascluster/dhcp/tests/test_leases.py' |
1607 | --- src/provisioningserver/dhcp/tests/test_leases.py 2015-03-25 15:33:23 +0000 |
1608 | +++ src/maascluster/dhcp/tests/test_leases.py 2015-05-01 07:23:47 +0000 |
1609 | @@ -22,14 +22,8 @@ |
1610 | import os |
1611 | from textwrap import dedent |
1612 | |
1613 | -from maastesting.factory import factory |
1614 | -from maastesting.utils import ( |
1615 | - age_file, |
1616 | - get_write_time, |
1617 | -) |
1618 | -from mock import Mock |
1619 | -from provisioningserver.dhcp import leases as leases_module |
1620 | -from provisioningserver.dhcp.leases import ( |
1621 | +from maascluster.dhcp import leases as leases_module |
1622 | +from maascluster.dhcp.leases import ( |
1623 | cache, |
1624 | check_lease_changes, |
1625 | LEASES_CACHE_KEY, |
1626 | @@ -37,7 +31,13 @@ |
1627 | parse_leases_file, |
1628 | record_lease_state, |
1629 | ) |
1630 | -from provisioningserver.testing.testcase import PservTestCase |
1631 | +from maascluster.testing.testcase import PservTestCase |
1632 | +from maastesting.factory import factory |
1633 | +from maastesting.utils import ( |
1634 | + age_file, |
1635 | + get_write_time, |
1636 | +) |
1637 | +from mock import Mock |
1638 | |
1639 | |
1640 | class TestHelpers(PservTestCase): |
1641 | |
1642 | === modified file 'src/maascluster/dhcp/tests/test_leases_parser.py' |
1643 | --- src/provisioningserver/dhcp/tests/test_leases_parser.py 2015-03-25 15:33:23 +0000 |
1644 | +++ src/maascluster/dhcp/tests/test_leases_parser.py 2015-05-01 07:23:47 +0000 |
1645 | @@ -18,14 +18,11 @@ |
1646 | from datetime import datetime |
1647 | from textwrap import dedent |
1648 | |
1649 | -from maastesting.factory import factory |
1650 | -from maastesting.testcase import MAASTestCase |
1651 | -from netaddr import IPAddress |
1652 | -from provisioningserver.dhcp import ( |
1653 | +from maascluster.dhcp import ( |
1654 | leases_parser, |
1655 | leases_parser_fast, |
1656 | ) |
1657 | -from provisioningserver.dhcp.leases_parser import ( |
1658 | +from maascluster.dhcp.leases_parser import ( |
1659 | combine_entries, |
1660 | gather_hosts, |
1661 | gather_leases, |
1662 | @@ -36,6 +33,9 @@ |
1663 | is_lease, |
1664 | lease_parser, |
1665 | ) |
1666 | +from maastesting.factory import factory |
1667 | +from maastesting.testcase import MAASTestCase |
1668 | +from netaddr import IPAddress |
1669 | |
1670 | |
1671 | def fake_parsed_lease(ip=None, mac=None, ends=None, |
1672 | |
1673 | === modified file 'src/maascluster/dhcp/tests/test_omshell.py' |
1674 | --- src/provisioningserver/dhcp/tests/test_omshell.py 2015-03-25 15:33:23 +0000 |
1675 | +++ src/maascluster/dhcp/tests/test_omshell.py 2015-05-01 07:23:47 +0000 |
1676 | @@ -20,6 +20,13 @@ |
1677 | import tempfile |
1678 | from textwrap import dedent |
1679 | |
1680 | +from maascluster.dhcp import omshell |
1681 | +from maascluster.dhcp.omshell import ( |
1682 | + call_dnssec_keygen, |
1683 | + generate_omapi_key, |
1684 | + Omshell, |
1685 | +) |
1686 | +from maascluster.utils.shell import ExternalProcessError |
1687 | from maastesting.factory import factory |
1688 | from maastesting.fakemethod import FakeMethod |
1689 | from maastesting.fixtures import TempDirectory |
1690 | @@ -29,13 +36,6 @@ |
1691 | ANY, |
1692 | Mock, |
1693 | ) |
1694 | -from provisioningserver.dhcp import omshell |
1695 | -from provisioningserver.dhcp.omshell import ( |
1696 | - call_dnssec_keygen, |
1697 | - generate_omapi_key, |
1698 | - Omshell, |
1699 | -) |
1700 | -from provisioningserver.utils.shell import ExternalProcessError |
1701 | from testtools.matchers import ( |
1702 | EndsWith, |
1703 | MatchesStructure, |
1704 | |
1705 | === modified file 'src/maascluster/dhcp/tests/test_writer.py' |
1706 | --- src/provisioningserver/dhcp/tests/test_writer.py 2015-03-25 15:33:23 +0000 |
1707 | +++ src/maascluster/dhcp/tests/test_writer.py 2015-05-01 07:23:47 +0000 |
1708 | @@ -1,7 +1,7 @@ |
1709 | # Copyright 2012-2014 Canonical Ltd. This software is licensed under the |
1710 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1711 | |
1712 | -"""Tests for `provisioningserver.dhcp.writer`.""" |
1713 | +"""Tests for `maascluster.dhcp.writer`.""" |
1714 | |
1715 | from __future__ import ( |
1716 | absolute_import, |
1717 | @@ -23,13 +23,13 @@ |
1718 | ) |
1719 | import sys |
1720 | |
1721 | +from maascluster.dhcp import writer |
1722 | +from maascluster.dhcp.testing.config import make_subnet_config |
1723 | +from maascluster.utils.fs import read_text_file |
1724 | from maastesting import root |
1725 | from maastesting.factory import factory |
1726 | from maastesting.testcase import MAASTestCase |
1727 | from mock import Mock |
1728 | -from provisioningserver.dhcp import writer |
1729 | -from provisioningserver.dhcp.testing.config import make_subnet_config |
1730 | -from provisioningserver.utils.fs import read_text_file |
1731 | from testtools.matchers import ( |
1732 | ContainsAll, |
1733 | MatchesStructure, |
1734 | |
1735 | === modified file 'src/maascluster/dhcp/writer.py' |
1736 | --- src/provisioningserver/dhcp/writer.py 2014-08-22 06:30:52 +0000 |
1737 | +++ src/maascluster/dhcp/writer.py 2015-05-01 07:23:47 +0000 |
1738 | @@ -19,7 +19,7 @@ |
1739 | |
1740 | import sys |
1741 | |
1742 | -from provisioningserver.dhcp import config |
1743 | +from maascluster.dhcp import config |
1744 | |
1745 | |
1746 | def add_arguments(parser): |
1747 | |
1748 | === modified file 'src/maascluster/diskless.py' |
1749 | --- src/provisioningserver/diskless.py 2015-03-25 15:33:23 +0000 |
1750 | +++ src/maascluster/diskless.py 2015-05-01 07:23:47 +0000 |
1751 | @@ -20,18 +20,18 @@ |
1752 | import os |
1753 | from textwrap import dedent |
1754 | |
1755 | -from provisioningserver import config |
1756 | -from provisioningserver.drivers.diskless import DisklessDriverRegistry |
1757 | -from provisioningserver.drivers.osystem import ( |
1758 | +from maascluster import config |
1759 | +from maascluster.drivers.diskless import DisklessDriverRegistry |
1760 | +from maascluster.drivers.osystem import ( |
1761 | BOOT_IMAGE_PURPOSE, |
1762 | OperatingSystemRegistry, |
1763 | ) |
1764 | -from provisioningserver.logger import get_maas_logger |
1765 | -from provisioningserver.utils.fs import ( |
1766 | +from maascluster.logger import get_maas_logger |
1767 | +from maascluster.utils.fs import ( |
1768 | atomic_symlink, |
1769 | atomic_write, |
1770 | ) |
1771 | -from provisioningserver.utils.shell import call_and_check |
1772 | +from maascluster.utils.shell import call_and_check |
1773 | |
1774 | |
1775 | maaslog = get_maas_logger("diskless") |
1776 | |
1777 | === modified file 'src/maascluster/dns/actions.py' |
1778 | --- src/provisioningserver/dns/actions.py 2015-04-25 01:23:46 +0000 |
1779 | +++ src/maascluster/dns/actions.py 2015-05-01 07:23:47 +0000 |
1780 | @@ -25,13 +25,13 @@ |
1781 | from subprocess import CalledProcessError |
1782 | from time import sleep |
1783 | |
1784 | -from provisioningserver.dns.config import ( |
1785 | +from maascluster.dns.config import ( |
1786 | DNSConfig, |
1787 | execute_rndc_command, |
1788 | set_up_options_conf, |
1789 | ) |
1790 | -from provisioningserver.logger import get_maas_logger |
1791 | -from provisioningserver.utils.shell import ExternalProcessError |
1792 | +from maascluster.logger import get_maas_logger |
1793 | +from maascluster.utils.shell import ExternalProcessError |
1794 | |
1795 | |
1796 | maaslog = get_maas_logger("dns") |
1797 | |
1798 | === modified file 'src/maascluster/dns/config.py' |
1799 | --- src/provisioningserver/dns/config.py 2015-04-24 19:49:30 +0000 |
1800 | +++ src/maascluster/dns/config.py 2015-05-01 07:23:47 +0000 |
1801 | @@ -29,9 +29,9 @@ |
1802 | import re |
1803 | import sys |
1804 | |
1805 | -from provisioningserver.utils import locate_config |
1806 | -from provisioningserver.utils.fs import atomic_write |
1807 | -from provisioningserver.utils.shell import call_and_check |
1808 | +from maascluster.utils import locate_config |
1809 | +from maascluster.utils.fs import atomic_write |
1810 | +from maascluster.utils.shell import call_and_check |
1811 | import tempita |
1812 | |
1813 | |
1814 | |
1815 | === modified file 'src/maascluster/dns/tests/test_actions.py' |
1816 | --- src/provisioningserver/dns/tests/test_actions.py 2015-04-28 21:53:40 +0000 |
1817 | +++ src/maascluster/dns/tests/test_actions.py 2015-05-01 07:23:47 +0000 |
1818 | @@ -1,7 +1,7 @@ |
1819 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
1820 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1821 | |
1822 | -"""Tests for :py:module:`provisioningserver.dns.actions`.""" |
1823 | +"""Tests for :py:module:`maascluster.dns.actions`.""" |
1824 | |
1825 | from __future__ import ( |
1826 | absolute_import, |
1827 | @@ -22,6 +22,18 @@ |
1828 | from textwrap import dedent |
1829 | |
1830 | from fixtures import FakeLogger |
1831 | +from maascluster.dns import actions |
1832 | +from maascluster.dns.config import ( |
1833 | + MAAS_NAMED_CONF_NAME, |
1834 | + MAAS_NAMED_CONF_OPTIONS_INSIDE_NAME, |
1835 | +) |
1836 | +from maascluster.dns.testing import patch_dns_config_path |
1837 | +from maascluster.dns.zoneconfig import ( |
1838 | + DNSForwardZoneConfig, |
1839 | + DNSReverseZoneConfig, |
1840 | +) |
1841 | +from maascluster.testing.testcase import PservTestCase |
1842 | +from maascluster.utils.shell import ExternalProcessError |
1843 | from maastesting.factory import factory |
1844 | from maastesting.matchers import ( |
1845 | MockCalledOnceWith, |
1846 | @@ -33,18 +45,6 @@ |
1847 | sentinel, |
1848 | ) |
1849 | from netaddr import IPNetwork |
1850 | -from provisioningserver.dns import actions |
1851 | -from provisioningserver.dns.config import ( |
1852 | - MAAS_NAMED_CONF_NAME, |
1853 | - MAAS_NAMED_CONF_OPTIONS_INSIDE_NAME, |
1854 | -) |
1855 | -from provisioningserver.dns.testing import patch_dns_config_path |
1856 | -from provisioningserver.dns.zoneconfig import ( |
1857 | - DNSForwardZoneConfig, |
1858 | - DNSReverseZoneConfig, |
1859 | -) |
1860 | -from provisioningserver.testing.testcase import PservTestCase |
1861 | -from provisioningserver.utils.shell import ExternalProcessError |
1862 | from testtools.matchers import ( |
1863 | AllMatch, |
1864 | Contains, |
1865 | |
1866 | === modified file 'src/maascluster/dns/tests/test_config.py' |
1867 | --- src/provisioningserver/dns/tests/test_config.py 2015-03-25 15:33:23 +0000 |
1868 | +++ src/maascluster/dns/tests/test_config.py 2015-05-01 07:23:47 +0000 |
1869 | @@ -20,13 +20,8 @@ |
1870 | from textwrap import dedent |
1871 | |
1872 | from fixtures import EnvironmentVariable |
1873 | -from maastesting.factory import factory |
1874 | -from maastesting.fakemethod import FakeMethod |
1875 | -from maastesting.testcase import MAASTestCase |
1876 | -from mock import Mock |
1877 | -from netaddr import IPNetwork |
1878 | -from provisioningserver.dns import config |
1879 | -from provisioningserver.dns.config import ( |
1880 | +from maascluster.dns import config |
1881 | +from maascluster.dns.config import ( |
1882 | compose_config_path, |
1883 | DEFAULT_CONTROLS, |
1884 | DNSConfig, |
1885 | @@ -45,15 +40,20 @@ |
1886 | set_up_rndc, |
1887 | uncomment_named_conf, |
1888 | ) |
1889 | -from provisioningserver.dns.testing import ( |
1890 | +from maascluster.dns.testing import ( |
1891 | patch_dns_config_path, |
1892 | patch_dns_default_controls, |
1893 | ) |
1894 | -from provisioningserver.dns.zoneconfig import ( |
1895 | +from maascluster.dns.zoneconfig import ( |
1896 | DNSForwardZoneConfig, |
1897 | DNSReverseZoneConfig, |
1898 | ) |
1899 | -from provisioningserver.utils import locate_config |
1900 | +from maascluster.utils import locate_config |
1901 | +from maastesting.factory import factory |
1902 | +from maastesting.fakemethod import FakeMethod |
1903 | +from maastesting.testcase import MAASTestCase |
1904 | +from mock import Mock |
1905 | +from netaddr import IPNetwork |
1906 | from testtools.matchers import ( |
1907 | Contains, |
1908 | ContainsAll, |
1909 | |
1910 | === modified file 'src/maascluster/dns/tests/test_zoneconfig.py' |
1911 | --- src/provisioningserver/dns/tests/test_zoneconfig.py 2015-03-25 15:33:23 +0000 |
1912 | +++ src/maascluster/dns/tests/test_zoneconfig.py 2015-05-01 07:23:47 +0000 |
1913 | @@ -21,6 +21,15 @@ |
1914 | import os.path |
1915 | import random |
1916 | |
1917 | +from maascluster.dns.config import ( |
1918 | + get_dns_config_dir, |
1919 | + SRVRecord, |
1920 | +) |
1921 | +from maascluster.dns.testing import patch_dns_config_path |
1922 | +from maascluster.dns.zoneconfig import ( |
1923 | + DNSForwardZoneConfig, |
1924 | + DNSReverseZoneConfig, |
1925 | +) |
1926 | from maastesting.factory import factory |
1927 | from maastesting.matchers import MockNotCalled |
1928 | from maastesting.testcase import MAASTestCase |
1929 | @@ -29,15 +38,6 @@ |
1930 | IPNetwork, |
1931 | IPRange, |
1932 | ) |
1933 | -from provisioningserver.dns.config import ( |
1934 | - get_dns_config_dir, |
1935 | - SRVRecord, |
1936 | -) |
1937 | -from provisioningserver.dns.testing import patch_dns_config_path |
1938 | -from provisioningserver.dns.zoneconfig import ( |
1939 | - DNSForwardZoneConfig, |
1940 | - DNSReverseZoneConfig, |
1941 | -) |
1942 | from testtools.matchers import ( |
1943 | Contains, |
1944 | ContainsAll, |
1945 | |
1946 | === modified file 'src/maascluster/dns/zoneconfig.py' |
1947 | --- src/provisioningserver/dns/zoneconfig.py 2015-03-25 15:33:23 +0000 |
1948 | +++ src/maascluster/dns/zoneconfig.py 2015-05-01 07:23:47 +0000 |
1949 | @@ -23,22 +23,22 @@ |
1950 | from itertools import chain |
1951 | import math |
1952 | |
1953 | +from maascluster.dns.config import ( |
1954 | + compose_config_path, |
1955 | + render_dns_template, |
1956 | + report_missing_config_dir, |
1957 | +) |
1958 | +from maascluster.utils.fs import incremental_write |
1959 | +from maascluster.utils.network import ( |
1960 | + intersect_iprange, |
1961 | + ip_range_within_network, |
1962 | +) |
1963 | from netaddr import ( |
1964 | IPAddress, |
1965 | IPNetwork, |
1966 | spanning_cidr, |
1967 | ) |
1968 | from netaddr.core import AddrFormatError |
1969 | -from provisioningserver.dns.config import ( |
1970 | - compose_config_path, |
1971 | - render_dns_template, |
1972 | - report_missing_config_dir, |
1973 | -) |
1974 | -from provisioningserver.utils.fs import incremental_write |
1975 | -from provisioningserver.utils.network import ( |
1976 | - intersect_iprange, |
1977 | - ip_range_within_network, |
1978 | -) |
1979 | |
1980 | |
1981 | def get_fqdn_or_ip_address(target): |
1982 | |
1983 | === modified file 'src/maascluster/drivers/__init__.py' |
1984 | --- src/provisioningserver/drivers/__init__.py 2015-03-25 15:33:23 +0000 |
1985 | +++ src/maascluster/drivers/__init__.py 2015-05-01 07:23:47 +0000 |
1986 | @@ -24,8 +24,8 @@ |
1987 | ) |
1988 | |
1989 | from jsonschema import validate |
1990 | -from provisioningserver.power_schema import JSON_POWER_TYPE_PARAMETERS |
1991 | -from provisioningserver.utils.registry import Registry |
1992 | +from maascluster.power_schema import JSON_POWER_TYPE_PARAMETERS |
1993 | +from maascluster.utils.registry import Registry |
1994 | |
1995 | # JSON schema representing the Django choices format as JSON; an array of |
1996 | # 2-item arrays. |
1997 | |
1998 | === modified file 'src/maascluster/drivers/diskless/__init__.py' |
1999 | --- src/provisioningserver/drivers/diskless/__init__.py 2015-03-25 15:33:23 +0000 |
2000 | +++ src/maascluster/drivers/diskless/__init__.py 2015-05-01 07:23:47 +0000 |
2001 | @@ -25,11 +25,11 @@ |
2002 | ) |
2003 | |
2004 | from jsonschema import validate |
2005 | -from provisioningserver.drivers import ( |
2006 | +from maascluster.drivers import ( |
2007 | JSON_SETTING_SCHEMA, |
2008 | validate_settings, |
2009 | ) |
2010 | -from provisioningserver.utils.registry import Registry |
2011 | +from maascluster.utils.registry import Registry |
2012 | |
2013 | |
2014 | JSON_DISKLESS_DRIVERS_SCHEMA = { |
2015 | |
2016 | === modified file 'src/maascluster/drivers/diskless/tests/test_base.py' |
2017 | --- src/provisioningserver/drivers/diskless/tests/test_base.py 2015-03-25 15:33:23 +0000 |
2018 | +++ src/maascluster/drivers/diskless/tests/test_base.py 2015-05-01 07:23:47 +0000 |
2019 | @@ -1,7 +1,7 @@ |
2020 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
2021 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2022 | |
2023 | -"""Tests for `provisioningserver.drivers.diskless`.""" |
2024 | +"""Tests for `maascluster.drivers.diskless`.""" |
2025 | |
2026 | from __future__ import ( |
2027 | absolute_import, |
2028 | @@ -14,18 +14,18 @@ |
2029 | __metaclass__ = type |
2030 | __all__ = [] |
2031 | |
2032 | -from maastesting.factory import factory |
2033 | -from maastesting.testcase import MAASTestCase |
2034 | -from mock import sentinel |
2035 | -from provisioningserver.drivers import ( |
2036 | +from maascluster.drivers import ( |
2037 | make_setting_field, |
2038 | validate_settings, |
2039 | ) |
2040 | -from provisioningserver.drivers.diskless import ( |
2041 | +from maascluster.drivers.diskless import ( |
2042 | DisklessDriver, |
2043 | DisklessDriverRegistry, |
2044 | ) |
2045 | -from provisioningserver.utils.testing import RegistryFixture |
2046 | +from maascluster.utils.testing import RegistryFixture |
2047 | +from maastesting.factory import factory |
2048 | +from maastesting.testcase import MAASTestCase |
2049 | +from mock import sentinel |
2050 | |
2051 | |
2052 | class FakeDisklessDriver(DisklessDriver): |
2053 | |
2054 | === modified file 'src/maascluster/drivers/hardware/esxi.py' |
2055 | --- src/provisioningserver/drivers/hardware/esxi.py 2015-03-26 15:39:45 +0000 |
2056 | +++ src/maascluster/drivers/hardware/esxi.py 2015-05-01 07:23:47 +0000 |
2057 | @@ -14,16 +14,16 @@ |
2058 | 'probe_esxi_and_enlist', |
2059 | ] |
2060 | |
2061 | -from provisioningserver.drivers.hardware.virsh import ( |
2062 | +from maascluster.drivers.hardware.virsh import ( |
2063 | VirshSSH, |
2064 | VirshVMState, |
2065 | VM_STATE_TO_POWER_STATE, |
2066 | ) |
2067 | -from provisioningserver.utils import ( |
2068 | +from maascluster.utils import ( |
2069 | commission_node, |
2070 | create_node, |
2071 | ) |
2072 | -from provisioningserver.utils.twisted import synchronous |
2073 | +from maascluster.utils.twisted import synchronous |
2074 | |
2075 | |
2076 | class ESXiError(Exception): |
2077 | |
2078 | === modified file 'src/maascluster/drivers/hardware/mscm.py' |
2079 | --- src/provisioningserver/drivers/hardware/mscm.py 2015-03-25 15:33:23 +0000 |
2080 | +++ src/maascluster/drivers/hardware/mscm.py 2015-05-01 07:23:47 +0000 |
2081 | @@ -24,15 +24,15 @@ |
2082 | |
2083 | import re |
2084 | |
2085 | +from maascluster.utils import ( |
2086 | + commission_node, |
2087 | + create_node, |
2088 | +) |
2089 | +from maascluster.utils.twisted import synchronous |
2090 | from paramiko import ( |
2091 | AutoAddPolicy, |
2092 | SSHClient, |
2093 | ) |
2094 | -from provisioningserver.utils import ( |
2095 | - commission_node, |
2096 | - create_node, |
2097 | -) |
2098 | -from provisioningserver.utils.twisted import synchronous |
2099 | |
2100 | |
2101 | cartridge_mapping = { |
2102 | |
2103 | === modified file 'src/maascluster/drivers/hardware/msftocs.py' |
2104 | --- src/provisioningserver/drivers/hardware/msftocs.py 2015-03-25 15:33:23 +0000 |
2105 | +++ src/maascluster/drivers/hardware/msftocs.py 2015-05-01 07:23:47 +0000 |
2106 | @@ -20,11 +20,11 @@ |
2107 | import urlparse |
2108 | |
2109 | from lxml.etree import fromstring |
2110 | -from provisioningserver.utils import ( |
2111 | +from maascluster.utils import ( |
2112 | commission_node, |
2113 | create_node, |
2114 | ) |
2115 | -from provisioningserver.utils.twisted import synchronous |
2116 | +from maascluster.utils.twisted import synchronous |
2117 | |
2118 | |
2119 | class MicrosoftOCSState(object): |
2120 | |
2121 | === modified file 'src/maascluster/drivers/hardware/seamicro.py' |
2122 | --- src/provisioningserver/drivers/hardware/seamicro.py 2015-03-25 15:33:23 +0000 |
2123 | +++ src/maascluster/drivers/hardware/seamicro.py 2015-05-01 07:23:47 +0000 |
2124 | @@ -22,13 +22,13 @@ |
2125 | import urllib2 |
2126 | import urlparse |
2127 | |
2128 | -from provisioningserver.logger import get_maas_logger |
2129 | -from provisioningserver.utils import ( |
2130 | +from maascluster.logger import get_maas_logger |
2131 | +from maascluster.utils import ( |
2132 | commission_node, |
2133 | create_node, |
2134 | ) |
2135 | -from provisioningserver.utils.twisted import synchronous |
2136 | -from provisioningserver.utils.url import compose_URL |
2137 | +from maascluster.utils.twisted import synchronous |
2138 | +from maascluster.utils.url import compose_URL |
2139 | from seamicroclient import exceptions as seamicro_exceptions |
2140 | from seamicroclient.v2 import client as seamicro_client |
2141 | |
2142 | |
2143 | === modified file 'src/maascluster/drivers/hardware/tests/test_apc.py' |
2144 | --- src/provisioningserver/drivers/hardware/tests/test_apc.py 2015-03-26 15:43:58 +0000 |
2145 | +++ src/maascluster/drivers/hardware/tests/test_apc.py 2015-05-01 07:23:47 +0000 |
2146 | @@ -1,7 +1,7 @@ |
2147 | # Copyright 2015 Canonical Ltd. This software is licensed under the |
2148 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2149 | |
2150 | -"""Tests for ``provisioningserver.drivers.hardware.apc``.""" |
2151 | +"""Tests for ``maascluster.drivers.hardware.apc``.""" |
2152 | |
2153 | from __future__ import ( |
2154 | absolute_import, |
2155 | @@ -16,6 +16,14 @@ |
2156 | |
2157 | from random import randint |
2158 | |
2159 | +from maascluster.drivers.hardware import apc as apc_module |
2160 | +from maascluster.drivers.hardware.apc import ( |
2161 | + APCException, |
2162 | + APCState, |
2163 | + APCTelnet, |
2164 | + power_control_apc, |
2165 | + power_state_apc, |
2166 | +) |
2167 | from maastesting.factory import factory |
2168 | from maastesting.matchers import ( |
2169 | MockCalledOnceWith, |
2170 | @@ -23,14 +31,6 @@ |
2171 | ) |
2172 | from maastesting.testcase import MAASTestCase |
2173 | from mock import call |
2174 | -from provisioningserver.drivers.hardware import apc as apc_module |
2175 | -from provisioningserver.drivers.hardware.apc import ( |
2176 | - APCException, |
2177 | - APCState, |
2178 | - APCTelnet, |
2179 | - power_control_apc, |
2180 | - power_state_apc, |
2181 | -) |
2182 | from testtools.matchers import Equals |
2183 | |
2184 | |
2185 | |
2186 | === modified file 'src/maascluster/drivers/hardware/tests/test_esxi.py' |
2187 | --- src/provisioningserver/drivers/hardware/tests/test_esxi.py 2015-03-26 18:03:44 +0000 |
2188 | +++ src/maascluster/drivers/hardware/tests/test_esxi.py 2015-05-01 07:23:47 +0000 |
2189 | @@ -1,7 +1,7 @@ |
2190 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
2191 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2192 | |
2193 | -"""Tests for `provisioningserver.drivers.hardware.esxi`. |
2194 | +"""Tests for `maascluster.drivers.hardware.esxi`. |
2195 | """ |
2196 | |
2197 | from __future__ import ( |
2198 | @@ -17,6 +17,8 @@ |
2199 | |
2200 | from textwrap import dedent |
2201 | |
2202 | +from maascluster.drivers.hardware import esxi as virsh |
2203 | +from maascluster.utils.twisted import asynchronous |
2204 | from maastesting.factory import factory |
2205 | from maastesting.matchers import ( |
2206 | MockCalledOnceWith, |
2207 | @@ -28,8 +30,6 @@ |
2208 | MAASTwistedRunTest, |
2209 | ) |
2210 | from mock import call |
2211 | -from provisioningserver.drivers.hardware import esxi as virsh |
2212 | -from provisioningserver.utils.twisted import asynchronous |
2213 | from testtools.testcase import ExpectedException |
2214 | from twisted.internet.defer import inlineCallbacks |
2215 | from twisted.internet.threads import deferToThread |
2216 | |
2217 | === modified file 'src/maascluster/drivers/hardware/tests/test_mscm.py' |
2218 | --- src/provisioningserver/drivers/hardware/tests/test_mscm.py 2015-03-25 15:33:23 +0000 |
2219 | +++ src/maascluster/drivers/hardware/tests/test_mscm.py 2015-05-01 07:23:47 +0000 |
2220 | @@ -1,7 +1,7 @@ |
2221 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
2222 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2223 | |
2224 | -"""Tests for ``provisioningserver.drivers.hardware.mscm``.""" |
2225 | +"""Tests for ``maascluster.drivers.hardware.mscm``.""" |
2226 | |
2227 | from __future__ import ( |
2228 | absolute_import, |
2229 | @@ -18,6 +18,17 @@ |
2230 | import re |
2231 | from StringIO import StringIO |
2232 | |
2233 | +from maascluster.drivers.hardware import mscm |
2234 | +from maascluster.drivers.hardware.mscm import ( |
2235 | + cartridge_mapping, |
2236 | + MSCM_CLI_API, |
2237 | + MSCMError, |
2238 | + MSCMState, |
2239 | + power_control_mscm, |
2240 | + power_state_mscm, |
2241 | + probe_and_enlist_mscm, |
2242 | +) |
2243 | +from maascluster.utils.twisted import asynchronous |
2244 | from maastesting.factory import factory |
2245 | from maastesting.matchers import ( |
2246 | MockAnyCall, |
2247 | @@ -29,17 +40,6 @@ |
2248 | MAASTwistedRunTest, |
2249 | ) |
2250 | from mock import Mock |
2251 | -from provisioningserver.drivers.hardware import mscm |
2252 | -from provisioningserver.drivers.hardware.mscm import ( |
2253 | - cartridge_mapping, |
2254 | - MSCM_CLI_API, |
2255 | - MSCMError, |
2256 | - MSCMState, |
2257 | - power_control_mscm, |
2258 | - power_state_mscm, |
2259 | - probe_and_enlist_mscm, |
2260 | -) |
2261 | -from provisioningserver.utils.twisted import asynchronous |
2262 | from testtools.matchers import Equals |
2263 | from testtools.testcase import ExpectedException |
2264 | from twisted.internet.defer import inlineCallbacks |
2265 | |
2266 | === modified file 'src/maascluster/drivers/hardware/tests/test_msftocs.py' |
2267 | --- src/provisioningserver/drivers/hardware/tests/test_msftocs.py 2015-03-25 15:33:23 +0000 |
2268 | +++ src/maascluster/drivers/hardware/tests/test_msftocs.py 2015-05-01 07:23:47 +0000 |
2269 | @@ -1,7 +1,7 @@ |
2270 | # Copyright 2015 Canonical Ltd. This software is licensed under the |
2271 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2272 | |
2273 | -"""Tests for ``provisioningserver.drivers.hardware.msftocs``.""" |
2274 | +"""Tests for ``maascluster.drivers.hardware.msftocs``.""" |
2275 | |
2276 | from __future__ import ( |
2277 | absolute_import, |
2278 | @@ -18,6 +18,16 @@ |
2279 | from textwrap import dedent |
2280 | import urlparse |
2281 | |
2282 | +from maascluster.drivers.hardware import msftocs |
2283 | +from maascluster.drivers.hardware.msftocs import ( |
2284 | + MicrosoftOCSAPI, |
2285 | + MicrosoftOCSException, |
2286 | + MicrosoftOCSState, |
2287 | + power_control_msftocs, |
2288 | + power_state_msftocs, |
2289 | + probe_and_enlist_msftocs, |
2290 | +) |
2291 | +from maascluster.utils.twisted import asynchronous |
2292 | from maastesting.factory import factory |
2293 | from maastesting.matchers import ( |
2294 | MockAnyCall, |
2295 | @@ -28,16 +38,6 @@ |
2296 | MAASTwistedRunTest, |
2297 | ) |
2298 | from mock import Mock |
2299 | -from provisioningserver.drivers.hardware import msftocs |
2300 | -from provisioningserver.drivers.hardware.msftocs import ( |
2301 | - MicrosoftOCSAPI, |
2302 | - MicrosoftOCSException, |
2303 | - MicrosoftOCSState, |
2304 | - power_control_msftocs, |
2305 | - power_state_msftocs, |
2306 | - probe_and_enlist_msftocs, |
2307 | -) |
2308 | -from provisioningserver.utils.twisted import asynchronous |
2309 | from testtools.matchers import Equals |
2310 | from testtools.testcase import ExpectedException |
2311 | from twisted.internet.defer import inlineCallbacks |
2312 | |
2313 | === modified file 'src/maascluster/drivers/hardware/tests/test_seamicro.py' |
2314 | --- src/provisioningserver/drivers/hardware/tests/test_seamicro.py 2015-03-25 15:33:23 +0000 |
2315 | +++ src/maascluster/drivers/hardware/tests/test_seamicro.py 2015-05-01 07:23:47 +0000 |
2316 | @@ -1,7 +1,7 @@ |
2317 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
2318 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2319 | |
2320 | -"""Tests for `provisioningserver.drivers.hardware.seamicro`. |
2321 | +"""Tests for `maascluster.drivers.hardware.seamicro`. |
2322 | """ |
2323 | |
2324 | from __future__ import ( |
2325 | @@ -18,6 +18,20 @@ |
2326 | import json |
2327 | import urlparse |
2328 | |
2329 | +from maascluster.drivers.hardware import seamicro |
2330 | +from maascluster.drivers.hardware.seamicro import ( |
2331 | + find_seamicro15k_servers, |
2332 | + power_control_seamicro15k_v09, |
2333 | + power_control_seamicro15k_v2, |
2334 | + power_query_seamicro15k_v2, |
2335 | + POWER_STATUS, |
2336 | + probe_seamicro15k_and_enlist, |
2337 | + SeaMicroAPIV09, |
2338 | + SeaMicroAPIV09Error, |
2339 | + SeaMicroError, |
2340 | + select_seamicro15k_api_version, |
2341 | +) |
2342 | +from maascluster.utils.twisted import asynchronous |
2343 | from maastesting.factory import factory |
2344 | from maastesting.matchers import ( |
2345 | MockCalledOnceWith, |
2346 | @@ -32,20 +46,6 @@ |
2347 | call, |
2348 | Mock, |
2349 | ) |
2350 | -from provisioningserver.drivers.hardware import seamicro |
2351 | -from provisioningserver.drivers.hardware.seamicro import ( |
2352 | - find_seamicro15k_servers, |
2353 | - power_control_seamicro15k_v09, |
2354 | - power_control_seamicro15k_v2, |
2355 | - power_query_seamicro15k_v2, |
2356 | - POWER_STATUS, |
2357 | - probe_seamicro15k_and_enlist, |
2358 | - SeaMicroAPIV09, |
2359 | - SeaMicroAPIV09Error, |
2360 | - SeaMicroError, |
2361 | - select_seamicro15k_api_version, |
2362 | -) |
2363 | -from provisioningserver.utils.twisted import asynchronous |
2364 | from twisted.internet.defer import inlineCallbacks |
2365 | from twisted.internet.threads import deferToThread |
2366 | |
2367 | |
2368 | === modified file 'src/maascluster/drivers/hardware/tests/test_ucsm.py' |
2369 | --- src/provisioningserver/drivers/hardware/tests/test_ucsm.py 2015-03-25 15:33:23 +0000 |
2370 | +++ src/maascluster/drivers/hardware/tests/test_ucsm.py 2015-05-01 07:23:47 +0000 |
2371 | @@ -1,7 +1,7 @@ |
2372 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
2373 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2374 | |
2375 | -"""Tests for ``provisioningserver.drivers.hardware.ucsm``.""" |
2376 | +"""Tests for ``maascluster.drivers.hardware.ucsm``.""" |
2377 | |
2378 | from __future__ import ( |
2379 | absolute_import, |
2380 | @@ -24,23 +24,8 @@ |
2381 | SubElement, |
2382 | XML, |
2383 | ) |
2384 | -from maastesting.factory import factory |
2385 | -from maastesting.matchers import ( |
2386 | - MockCalledOnceWith, |
2387 | - MockCallsMatch, |
2388 | - MockNotCalled, |
2389 | -) |
2390 | -from maastesting.testcase import ( |
2391 | - MAASTestCase, |
2392 | - MAASTwistedRunTest, |
2393 | -) |
2394 | -from mock import ( |
2395 | - ANY, |
2396 | - call, |
2397 | - Mock, |
2398 | -) |
2399 | -from provisioningserver.drivers.hardware import ucsm |
2400 | -from provisioningserver.drivers.hardware.ucsm import ( |
2401 | +from maascluster.drivers.hardware import ucsm |
2402 | +from maascluster.drivers.hardware.ucsm import ( |
2403 | get_children, |
2404 | get_first_booter, |
2405 | get_macs, |
2406 | @@ -63,7 +48,22 @@ |
2407 | UCSM_XML_API, |
2408 | UCSM_XML_API_Error, |
2409 | ) |
2410 | -from provisioningserver.utils.twisted import asynchronous |
2411 | +from maascluster.utils.twisted import asynchronous |
2412 | +from maastesting.factory import factory |
2413 | +from maastesting.matchers import ( |
2414 | + MockCalledOnceWith, |
2415 | + MockCallsMatch, |
2416 | + MockNotCalled, |
2417 | +) |
2418 | +from maastesting.testcase import ( |
2419 | + MAASTestCase, |
2420 | + MAASTwistedRunTest, |
2421 | +) |
2422 | +from mock import ( |
2423 | + ANY, |
2424 | + call, |
2425 | + Mock, |
2426 | +) |
2427 | from testtools.matchers import Equals |
2428 | from twisted.internet.defer import inlineCallbacks |
2429 | from twisted.internet.threads import deferToThread |
2430 | |
2431 | === modified file 'src/maascluster/drivers/hardware/tests/test_virsh.py' |
2432 | --- src/provisioningserver/drivers/hardware/tests/test_virsh.py 2015-03-25 15:33:23 +0000 |
2433 | +++ src/maascluster/drivers/hardware/tests/test_virsh.py 2015-05-01 07:23:47 +0000 |
2434 | @@ -1,7 +1,7 @@ |
2435 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
2436 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2437 | |
2438 | -"""Tests for `provisioningserver.drivers.hardware.virsh`. |
2439 | +"""Tests for `maascluster.drivers.hardware.virsh`. |
2440 | """ |
2441 | |
2442 | from __future__ import ( |
2443 | @@ -18,6 +18,8 @@ |
2444 | import random |
2445 | from textwrap import dedent |
2446 | |
2447 | +from maascluster.drivers.hardware import virsh |
2448 | +from maascluster.utils.twisted import asynchronous |
2449 | from maastesting.factory import factory |
2450 | from maastesting.matchers import ( |
2451 | MockCalledOnceWith, |
2452 | @@ -29,8 +31,6 @@ |
2453 | MAASTwistedRunTest, |
2454 | ) |
2455 | from mock import call |
2456 | -from provisioningserver.drivers.hardware import virsh |
2457 | -from provisioningserver.utils.twisted import asynchronous |
2458 | from testtools.testcase import ExpectedException |
2459 | from twisted.internet.defer import inlineCallbacks |
2460 | from twisted.internet.threads import deferToThread |
2461 | |
2462 | === modified file 'src/maascluster/drivers/hardware/tests/test_vsphere.py' |
2463 | --- src/provisioningserver/drivers/hardware/tests/test_vsphere.py 2015-04-16 07:56:42 +0000 |
2464 | +++ src/maascluster/drivers/hardware/tests/test_vsphere.py 2015-05-01 07:23:47 +0000 |
2465 | @@ -1,7 +1,7 @@ |
2466 | # Copyright 2015 Canonical Ltd. This software is licensed under the |
2467 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2468 | |
2469 | -"""Tests for `provisioningserver.drivers.hardware.vsphere`. |
2470 | +"""Tests for `maascluster.drivers.hardware.vsphere`. |
2471 | """ |
2472 | |
2473 | from __future__ import ( |
2474 | @@ -18,17 +18,17 @@ |
2475 | |
2476 | import random |
2477 | |
2478 | +from maascluster.drivers.hardware import vsphere |
2479 | +from maascluster.drivers.hardware.vsphere import ( |
2480 | + VMwarePyvmomiAPI, |
2481 | + VMwareVMNotFound, |
2482 | +) |
2483 | +from maascluster.utils.twisted import asynchronous |
2484 | from maastesting.factory import factory |
2485 | from maastesting.testcase import ( |
2486 | MAASTestCase, |
2487 | MAASTwistedRunTest, |
2488 | ) |
2489 | -from provisioningserver.drivers.hardware import vsphere |
2490 | -from provisioningserver.drivers.hardware.vsphere import ( |
2491 | - VMwarePyvmomiAPI, |
2492 | - VMwareVMNotFound, |
2493 | -) |
2494 | -from provisioningserver.utils.twisted import asynchronous |
2495 | from testtools import ExpectedException |
2496 | from testtools.matchers import ( |
2497 | Equals, |
2498 | |
2499 | === modified file 'src/maascluster/drivers/hardware/ucsm.py' |
2500 | --- src/provisioningserver/drivers/hardware/ucsm.py 2015-03-25 15:33:23 +0000 |
2501 | +++ src/maascluster/drivers/hardware/ucsm.py 2015-05-01 07:23:47 +0000 |
2502 | @@ -75,11 +75,11 @@ |
2503 | tostring, |
2504 | XML, |
2505 | ) |
2506 | -from provisioningserver.utils import ( |
2507 | +from maascluster.utils import ( |
2508 | commission_node, |
2509 | create_node, |
2510 | ) |
2511 | -from provisioningserver.utils.twisted import synchronous |
2512 | +from maascluster.utils.twisted import synchronous |
2513 | |
2514 | |
2515 | str = None |
2516 | |
2517 | === modified file 'src/maascluster/drivers/hardware/virsh.py' |
2518 | --- src/provisioningserver/drivers/hardware/virsh.py 2015-03-25 15:33:23 +0000 |
2519 | +++ src/maascluster/drivers/hardware/virsh.py 2015-05-01 07:23:47 +0000 |
2520 | @@ -15,12 +15,12 @@ |
2521 | ] |
2522 | |
2523 | from lxml import etree |
2524 | -import pexpect |
2525 | -from provisioningserver.utils import ( |
2526 | +from maascluster.utils import ( |
2527 | commission_node, |
2528 | create_node, |
2529 | ) |
2530 | -from provisioningserver.utils.twisted import synchronous |
2531 | +from maascluster.utils.twisted import synchronous |
2532 | +import pexpect |
2533 | |
2534 | |
2535 | XPATH_ARCH = "/domain/os/type/@arch" |
2536 | |
2537 | === modified file 'src/maascluster/drivers/hardware/vsphere.py' |
2538 | --- src/provisioningserver/drivers/hardware/vsphere.py 2015-04-16 08:27:27 +0000 |
2539 | +++ src/maascluster/drivers/hardware/vsphere.py 2015-05-01 07:23:47 +0000 |
2540 | @@ -20,12 +20,12 @@ |
2541 | from collections import OrderedDict |
2542 | import traceback |
2543 | |
2544 | -from provisioningserver.logger import get_maas_logger |
2545 | -from provisioningserver.utils import ( |
2546 | +from maascluster.logger import get_maas_logger |
2547 | +from maascluster.utils import ( |
2548 | commission_node, |
2549 | create_node, |
2550 | ) |
2551 | -from provisioningserver.utils.twisted import synchronous |
2552 | +from maascluster.utils.twisted import synchronous |
2553 | |
2554 | |
2555 | try: |
2556 | |
2557 | === modified file 'src/maascluster/drivers/osystem/__init__.py' |
2558 | --- src/provisioningserver/drivers/osystem/__init__.py 2015-03-25 15:33:23 +0000 |
2559 | +++ src/maascluster/drivers/osystem/__init__.py 2015-05-01 07:23:47 +0000 |
2560 | @@ -26,7 +26,7 @@ |
2561 | ) |
2562 | from collections import namedtuple |
2563 | |
2564 | -from provisioningserver.utils.registry import Registry |
2565 | +from maascluster.utils.registry import Registry |
2566 | |
2567 | |
2568 | class BOOT_IMAGE_PURPOSE: |
2569 | @@ -54,7 +54,7 @@ |
2570 | def list_boot_images_for(osystem): |
2571 | """List all boot images for the given osystem.""" |
2572 | # Circular import |
2573 | - from provisioningserver.rpc.boot_images import list_boot_images |
2574 | + from maascluster.rpc.boot_images import list_boot_images |
2575 | return [ |
2576 | image |
2577 | for image in list_boot_images() |
2578 | @@ -242,11 +242,11 @@ |
2579 | """Registry for operating system classes.""" |
2580 | |
2581 | |
2582 | -from provisioningserver.drivers.osystem.ubuntu import UbuntuOS |
2583 | -from provisioningserver.drivers.osystem.centos import CentOS |
2584 | -from provisioningserver.drivers.osystem.custom import CustomOS |
2585 | -from provisioningserver.drivers.osystem.windows import WindowsOS |
2586 | -from provisioningserver.drivers.osystem.suse import SUSEOS |
2587 | +from maascluster.drivers.osystem.ubuntu import UbuntuOS |
2588 | +from maascluster.drivers.osystem.centos import CentOS |
2589 | +from maascluster.drivers.osystem.custom import CustomOS |
2590 | +from maascluster.drivers.osystem.windows import WindowsOS |
2591 | +from maascluster.drivers.osystem.suse import SUSEOS |
2592 | |
2593 | builtin_osystems = [ |
2594 | UbuntuOS(), |
2595 | |
2596 | === modified file 'src/maascluster/drivers/osystem/centos.py' |
2597 | --- src/provisioningserver/drivers/osystem/centos.py 2015-03-25 15:33:23 +0000 |
2598 | +++ src/maascluster/drivers/osystem/centos.py 2015-05-01 07:23:47 +0000 |
2599 | @@ -18,7 +18,7 @@ |
2600 | |
2601 | import re |
2602 | |
2603 | -from provisioningserver.drivers.osystem import ( |
2604 | +from maascluster.drivers.osystem import ( |
2605 | BOOT_IMAGE_PURPOSE, |
2606 | OperatingSystem, |
2607 | ) |
2608 | |
2609 | === modified file 'src/maascluster/drivers/osystem/custom.py' |
2610 | --- src/provisioningserver/drivers/osystem/custom.py 2015-03-25 15:33:23 +0000 |
2611 | +++ src/maascluster/drivers/osystem/custom.py 2015-05-01 07:23:47 +0000 |
2612 | @@ -18,8 +18,8 @@ |
2613 | |
2614 | import os |
2615 | |
2616 | -from provisioningserver.config import BOOT_RESOURCES_STORAGE |
2617 | -from provisioningserver.drivers.osystem import ( |
2618 | +from maascluster.config import BOOT_RESOURCES_STORAGE |
2619 | +from maascluster.drivers.osystem import ( |
2620 | BOOT_IMAGE_PURPOSE, |
2621 | OperatingSystem, |
2622 | ) |
2623 | |
2624 | === modified file 'src/maascluster/drivers/osystem/suse.py' |
2625 | --- src/provisioningserver/drivers/osystem/suse.py 2015-03-25 15:33:23 +0000 |
2626 | +++ src/maascluster/drivers/osystem/suse.py 2015-05-01 07:23:47 +0000 |
2627 | @@ -16,7 +16,7 @@ |
2628 | "SUSEOS", |
2629 | ] |
2630 | |
2631 | -from provisioningserver.drivers.osystem import ( |
2632 | +from maascluster.drivers.osystem import ( |
2633 | BOOT_IMAGE_PURPOSE, |
2634 | OperatingSystem, |
2635 | ) |
2636 | |
2637 | === modified file 'src/maascluster/drivers/osystem/tests/test_base.py' |
2638 | --- src/provisioningserver/drivers/osystem/tests/test_base.py 2015-03-25 15:33:23 +0000 |
2639 | +++ src/maascluster/drivers/osystem/tests/test_base.py 2015-05-01 07:23:47 +0000 |
2640 | @@ -1,7 +1,7 @@ |
2641 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
2642 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2643 | |
2644 | -"""Tests for `provisioningserver.drivers.osystem`.""" |
2645 | +"""Tests for `maascluster.drivers.osystem`.""" |
2646 | |
2647 | from __future__ import ( |
2648 | absolute_import, |
2649 | @@ -14,16 +14,16 @@ |
2650 | __metaclass__ = type |
2651 | __all__ = [] |
2652 | |
2653 | +from maascluster.drivers import osystem as osystem_module |
2654 | +from maascluster.drivers.osystem import ( |
2655 | + BOOT_IMAGE_PURPOSE, |
2656 | + OperatingSystemRegistry, |
2657 | +) |
2658 | +from maascluster.testing.os import make_osystem |
2659 | +from maascluster.utils.testing import RegistryFixture |
2660 | from maastesting.factory import factory |
2661 | from maastesting.testcase import MAASTestCase |
2662 | from mock import sentinel |
2663 | -from provisioningserver.drivers import osystem as osystem_module |
2664 | -from provisioningserver.drivers.osystem import ( |
2665 | - BOOT_IMAGE_PURPOSE, |
2666 | - OperatingSystemRegistry, |
2667 | -) |
2668 | -from provisioningserver.testing.os import make_osystem |
2669 | -from provisioningserver.utils.testing import RegistryFixture |
2670 | |
2671 | |
2672 | class TestOperatingSystem(MAASTestCase): |
2673 | |
2674 | === modified file 'src/maascluster/drivers/osystem/tests/test_centos.py' |
2675 | --- src/provisioningserver/drivers/osystem/tests/test_centos.py 2015-03-25 15:33:23 +0000 |
2676 | +++ src/maascluster/drivers/osystem/tests/test_centos.py 2015-05-01 07:23:47 +0000 |
2677 | @@ -16,13 +16,13 @@ |
2678 | |
2679 | from itertools import product |
2680 | |
2681 | -from maastesting.factory import factory |
2682 | -from maastesting.testcase import MAASTestCase |
2683 | -from provisioningserver.drivers.osystem.centos import ( |
2684 | +from maascluster.drivers.osystem.centos import ( |
2685 | BOOT_IMAGE_PURPOSE, |
2686 | CentOS, |
2687 | DISTRO_SERIES_DEFAULT, |
2688 | ) |
2689 | +from maastesting.factory import factory |
2690 | +from maastesting.testcase import MAASTestCase |
2691 | from testtools.matchers import Equals |
2692 | |
2693 | |
2694 | |
2695 | === modified file 'src/maascluster/drivers/osystem/tests/test_custom.py' |
2696 | --- src/provisioningserver/drivers/osystem/tests/test_custom.py 2015-03-25 15:33:23 +0000 |
2697 | +++ src/maascluster/drivers/osystem/tests/test_custom.py 2015-05-01 07:23:47 +0000 |
2698 | @@ -17,13 +17,13 @@ |
2699 | from itertools import product |
2700 | import os |
2701 | |
2702 | -from maastesting.factory import factory |
2703 | -from maastesting.testcase import MAASTestCase |
2704 | -from provisioningserver.drivers.osystem import custom |
2705 | -from provisioningserver.drivers.osystem.custom import ( |
2706 | +from maascluster.drivers.osystem import custom |
2707 | +from maascluster.drivers.osystem.custom import ( |
2708 | BOOT_IMAGE_PURPOSE, |
2709 | CustomOS, |
2710 | ) |
2711 | +from maastesting.factory import factory |
2712 | +from maastesting.testcase import MAASTestCase |
2713 | |
2714 | |
2715 | class TestCustomOS(MAASTestCase): |
2716 | |
2717 | === modified file 'src/maascluster/drivers/osystem/tests/test_debian_networking.py' |
2718 | --- src/provisioningserver/drivers/osystem/tests/test_debian_networking.py 2015-03-25 15:33:23 +0000 |
2719 | +++ src/maascluster/drivers/osystem/tests/test_debian_networking.py 2015-05-01 07:23:47 +0000 |
2720 | @@ -17,17 +17,17 @@ |
2721 | from random import randint |
2722 | from textwrap import dedent |
2723 | |
2724 | -from maastesting.factory import factory |
2725 | -from maastesting.matchers import MockCalledOnceWith |
2726 | -from maastesting.testcase import MAASTestCase |
2727 | -from mock import ANY |
2728 | -from provisioningserver.drivers.osystem import debian_networking |
2729 | -from provisioningserver.drivers.osystem.debian_networking import ( |
2730 | +from maascluster.drivers.osystem import debian_networking |
2731 | +from maascluster.drivers.osystem.debian_networking import ( |
2732 | compose_ipv4_stanza, |
2733 | compose_ipv6_stanza, |
2734 | compose_network_interfaces, |
2735 | has_static_ipv6_address, |
2736 | ) |
2737 | +from maastesting.factory import factory |
2738 | +from maastesting.matchers import MockCalledOnceWith |
2739 | +from maastesting.testcase import MAASTestCase |
2740 | +from mock import ANY |
2741 | from testtools.matchers import Contains |
2742 | |
2743 | |
2744 | |
2745 | === modified file 'src/maascluster/drivers/osystem/tests/test_suse.py' |
2746 | --- src/provisioningserver/drivers/osystem/tests/test_suse.py 2015-03-25 15:33:23 +0000 |
2747 | +++ src/maascluster/drivers/osystem/tests/test_suse.py 2015-05-01 07:23:47 +0000 |
2748 | @@ -17,14 +17,14 @@ |
2749 | from itertools import product |
2750 | import random |
2751 | |
2752 | -from maastesting.factory import factory |
2753 | -from maastesting.testcase import MAASTestCase |
2754 | -from provisioningserver.drivers.osystem.suse import ( |
2755 | +from maascluster.drivers.osystem.suse import ( |
2756 | BOOT_IMAGE_PURPOSE, |
2757 | DISTRO_SERIES_CHOICES, |
2758 | DISTRO_SERIES_DEFAULT, |
2759 | SUSEOS, |
2760 | ) |
2761 | +from maastesting.factory import factory |
2762 | +from maastesting.testcase import MAASTestCase |
2763 | |
2764 | |
2765 | class TestSUSEOS(MAASTestCase): |
2766 | |
2767 | === modified file 'src/maascluster/drivers/osystem/tests/test_ubuntu.py' |
2768 | --- src/provisioningserver/drivers/osystem/tests/test_ubuntu.py 2015-03-25 15:33:23 +0000 |
2769 | +++ src/maascluster/drivers/osystem/tests/test_ubuntu.py 2015-05-01 07:23:47 +0000 |
2770 | @@ -18,17 +18,17 @@ |
2771 | import random |
2772 | |
2773 | from distro_info import UbuntuDistroInfo |
2774 | +from maascluster.drivers.osystem import BOOT_IMAGE_PURPOSE |
2775 | +from maascluster.drivers.osystem.debian_networking import ( |
2776 | + compose_network_interfaces, |
2777 | +) |
2778 | +from maascluster.drivers.osystem.ubuntu import UbuntuOS |
2779 | +import maascluster.drivers.osystem.ubuntu as ubuntu_module |
2780 | +from maascluster.udev import compose_network_interfaces_udev_rules |
2781 | +from maascluster.utils.curtin import compose_recursive_copy |
2782 | from maastesting.factory import factory |
2783 | from maastesting.matchers import MockAnyCall |
2784 | from maastesting.testcase import MAASTestCase |
2785 | -from provisioningserver.drivers.osystem import BOOT_IMAGE_PURPOSE |
2786 | -from provisioningserver.drivers.osystem.debian_networking import ( |
2787 | - compose_network_interfaces, |
2788 | -) |
2789 | -from provisioningserver.drivers.osystem.ubuntu import UbuntuOS |
2790 | -import provisioningserver.drivers.osystem.ubuntu as ubuntu_module |
2791 | -from provisioningserver.udev import compose_network_interfaces_udev_rules |
2792 | -from provisioningserver.utils.curtin import compose_recursive_copy |
2793 | from testtools.matchers import ( |
2794 | AllMatch, |
2795 | HasLength, |
2796 | |
2797 | === modified file 'src/maascluster/drivers/osystem/tests/test_windows.py' |
2798 | --- src/provisioningserver/drivers/osystem/tests/test_windows.py 2015-03-25 15:33:23 +0000 |
2799 | +++ src/maascluster/drivers/osystem/tests/test_windows.py 2015-05-01 07:23:47 +0000 |
2800 | @@ -17,13 +17,11 @@ |
2801 | import os |
2802 | import random |
2803 | |
2804 | -from maastesting.factory import factory |
2805 | -from maastesting.testcase import MAASTestCase |
2806 | -from provisioningserver.drivers.osystem import ( |
2807 | +from maascluster.drivers.osystem import ( |
2808 | Node, |
2809 | Token, |
2810 | ) |
2811 | -from provisioningserver.drivers.osystem.windows import ( |
2812 | +from maascluster.drivers.osystem.windows import ( |
2813 | BOOT_IMAGE_PURPOSE, |
2814 | Config, |
2815 | REQUIRE_LICENSE_KEY, |
2816 | @@ -31,6 +29,8 @@ |
2817 | WINDOWS_DEFAULT, |
2818 | WindowsOS, |
2819 | ) |
2820 | +from maastesting.factory import factory |
2821 | +from maastesting.testcase import MAASTestCase |
2822 | |
2823 | |
2824 | class TestWindowsOS(MAASTestCase): |
2825 | |
2826 | === modified file 'src/maascluster/drivers/osystem/ubuntu.py' |
2827 | --- src/provisioningserver/drivers/osystem/ubuntu.py 2015-03-25 15:33:23 +0000 |
2828 | +++ src/maascluster/drivers/osystem/ubuntu.py 2015-05-01 07:23:47 +0000 |
2829 | @@ -17,15 +17,15 @@ |
2830 | ] |
2831 | |
2832 | from distro_info import UbuntuDistroInfo |
2833 | -from provisioningserver.drivers.osystem import ( |
2834 | +from maascluster.drivers.osystem import ( |
2835 | BOOT_IMAGE_PURPOSE, |
2836 | OperatingSystem, |
2837 | ) |
2838 | -from provisioningserver.drivers.osystem.debian_networking import ( |
2839 | +from maascluster.drivers.osystem.debian_networking import ( |
2840 | compose_network_interfaces, |
2841 | ) |
2842 | -from provisioningserver.udev import compose_network_interfaces_udev_rules |
2843 | -from provisioningserver.utils.curtin import ( |
2844 | +from maascluster.udev import compose_network_interfaces_udev_rules |
2845 | +from maascluster.utils.curtin import ( |
2846 | compose_recursive_copy, |
2847 | compose_write_text_file, |
2848 | ) |
2849 | |
2850 | === modified file 'src/maascluster/drivers/osystem/windows.py' |
2851 | --- src/provisioningserver/drivers/osystem/windows.py 2015-03-25 15:33:23 +0000 |
2852 | +++ src/maascluster/drivers/osystem/windows.py 2015-05-01 07:23:47 +0000 |
2853 | @@ -19,8 +19,8 @@ |
2854 | import os |
2855 | import re |
2856 | |
2857 | -from provisioningserver.config import Config |
2858 | -from provisioningserver.drivers.osystem import ( |
2859 | +from maascluster.config import Config |
2860 | +from maascluster.drivers.osystem import ( |
2861 | BOOT_IMAGE_PURPOSE, |
2862 | OperatingSystem, |
2863 | ) |
2864 | |
2865 | === modified file 'src/maascluster/drivers/power/__init__.py' |
2866 | --- src/provisioningserver/drivers/power/__init__.py 2015-03-25 15:33:23 +0000 |
2867 | +++ src/maascluster/drivers/power/__init__.py 2015-05-01 07:23:47 +0000 |
2868 | @@ -31,12 +31,12 @@ |
2869 | ) |
2870 | |
2871 | from jsonschema import validate |
2872 | -from provisioningserver.drivers import ( |
2873 | +from maascluster.drivers import ( |
2874 | JSON_SETTING_SCHEMA, |
2875 | validate_settings, |
2876 | ) |
2877 | -from provisioningserver.utils import pause |
2878 | -from provisioningserver.utils.registry import Registry |
2879 | +from maascluster.utils import pause |
2880 | +from maascluster.utils.registry import Registry |
2881 | from twisted.internet import reactor |
2882 | from twisted.internet.defer import ( |
2883 | inlineCallbacks, |
2884 | |
2885 | === modified file 'src/maascluster/drivers/power/tests/test_base.py' |
2886 | --- src/provisioningserver/drivers/power/tests/test_base.py 2015-03-25 15:33:23 +0000 |
2887 | +++ src/maascluster/drivers/power/tests/test_base.py 2015-05-01 07:23:47 +0000 |
2888 | @@ -1,7 +1,7 @@ |
2889 | # Copyright 2015 Canonical Ltd. This software is licensed under the |
2890 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2891 | |
2892 | -"""Tests for `provisioningserver.drivers.power`.""" |
2893 | +"""Tests for `maascluster.drivers.power`.""" |
2894 | |
2895 | from __future__ import ( |
2896 | absolute_import, |
2897 | @@ -14,19 +14,12 @@ |
2898 | __metaclass__ = type |
2899 | __all__ = [] |
2900 | |
2901 | -from maastesting.factory import factory |
2902 | -from maastesting.matchers import ( |
2903 | - MockCalledOnceWith, |
2904 | - MockNotCalled, |
2905 | -) |
2906 | -from maastesting.testcase import MAASTestCase |
2907 | -from mock import sentinel |
2908 | -from provisioningserver.drivers import ( |
2909 | +from maascluster.drivers import ( |
2910 | make_setting_field, |
2911 | power, |
2912 | validate_settings, |
2913 | ) |
2914 | -from provisioningserver.drivers.power import ( |
2915 | +from maascluster.drivers.power import ( |
2916 | get_error_message, |
2917 | PowerActionError, |
2918 | PowerAuthError, |
2919 | @@ -39,7 +32,14 @@ |
2920 | PowerSettingError, |
2921 | PowerToolError, |
2922 | ) |
2923 | -from provisioningserver.utils.testing import RegistryFixture |
2924 | +from maascluster.utils.testing import RegistryFixture |
2925 | +from maastesting.factory import factory |
2926 | +from maastesting.matchers import ( |
2927 | + MockCalledOnceWith, |
2928 | + MockNotCalled, |
2929 | +) |
2930 | +from maastesting.testcase import MAASTestCase |
2931 | +from mock import sentinel |
2932 | from testtools.deferredruntest import AsynchronousDeferredRunTest |
2933 | from testtools.matchers import Equals |
2934 | from testtools.testcase import ExpectedException |
2935 | |
2936 | === modified file 'src/maascluster/drivers/tests/test_base.py' |
2937 | --- src/provisioningserver/drivers/tests/test_base.py 2015-03-25 15:33:23 +0000 |
2938 | +++ src/maascluster/drivers/tests/test_base.py 2015-05-01 07:23:47 +0000 |
2939 | @@ -1,7 +1,7 @@ |
2940 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
2941 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2942 | |
2943 | -"""Tests for `provisioningserver.drivers`.""" |
2944 | +"""Tests for `maascluster.drivers`.""" |
2945 | |
2946 | from __future__ import ( |
2947 | absolute_import, |
2948 | @@ -20,12 +20,8 @@ |
2949 | validate, |
2950 | ValidationError, |
2951 | ) |
2952 | -from maastesting.factory import factory |
2953 | -from maastesting.matchers import MockCalledOnceWith |
2954 | -from maastesting.testcase import MAASTestCase |
2955 | -from mock import sentinel |
2956 | -from provisioningserver import drivers |
2957 | -from provisioningserver.drivers import ( |
2958 | +from maascluster import drivers |
2959 | +from maascluster.drivers import ( |
2960 | Architecture, |
2961 | ArchitectureRegistry, |
2962 | BootResourceRegistry, |
2963 | @@ -35,7 +31,11 @@ |
2964 | SETTING_PARAMETER_FIELD_SCHEMA, |
2965 | validate_settings, |
2966 | ) |
2967 | -from provisioningserver.utils.testing import RegistryFixture |
2968 | +from maascluster.utils.testing import RegistryFixture |
2969 | +from maastesting.factory import factory |
2970 | +from maastesting.matchers import MockCalledOnceWith |
2971 | +from maastesting.testcase import MAASTestCase |
2972 | +from mock import sentinel |
2973 | from testtools.matchers import ContainsAll |
2974 | |
2975 | |
2976 | |
2977 | === modified file 'src/maascluster/events.py' |
2978 | --- src/provisioningserver/events.py 2015-03-25 15:33:23 +0000 |
2979 | +++ src/maascluster/events.py 2015-05-01 07:23:47 +0000 |
2980 | @@ -25,18 +25,18 @@ |
2981 | WARN, |
2982 | ) |
2983 | |
2984 | -from provisioningserver.logger.log import get_maas_logger |
2985 | -from provisioningserver.rpc import getRegionClient |
2986 | -from provisioningserver.rpc.exceptions import ( |
2987 | +from maascluster.logger.log import get_maas_logger |
2988 | +from maascluster.rpc import getRegionClient |
2989 | +from maascluster.rpc.exceptions import ( |
2990 | NoSuchEventType, |
2991 | NoSuchNode, |
2992 | ) |
2993 | -from provisioningserver.rpc.region import ( |
2994 | +from maascluster.rpc.region import ( |
2995 | RegisterEventType, |
2996 | SendEvent, |
2997 | SendEventMACAddress, |
2998 | ) |
2999 | -from provisioningserver.utils.twisted import asynchronous |
3000 | +from maascluster.utils.twisted import asynchronous |
3001 | from twisted.internet.defer import inlineCallbacks |
3002 | |
3003 | |
3004 | |
3005 | === modified file 'src/maascluster/import_images/boot_image_mapping.py' |
3006 | --- src/provisioningserver/import_images/boot_image_mapping.py 2014-10-20 20:32:00 +0000 |
3007 | +++ src/maascluster/import_images/boot_image_mapping.py 2015-05-01 07:23:47 +0000 |
3008 | @@ -18,8 +18,8 @@ |
3009 | |
3010 | import json |
3011 | |
3012 | -from provisioningserver.import_images.helpers import ImageSpec |
3013 | -from provisioningserver.utils import dict_depth |
3014 | +from maascluster.import_images.helpers import ImageSpec |
3015 | +from maascluster.utils import dict_depth |
3016 | |
3017 | |
3018 | def gen_image_spec_with_resource(os, data): |
3019 | |
3020 | === modified file 'src/maascluster/import_images/boot_resources.py' |
3021 | --- src/provisioningserver/import_images/boot_resources.py 2015-03-25 15:33:23 +0000 |
3022 | +++ src/maascluster/import_images/boot_resources.py 2015-05-01 07:23:47 +0000 |
3023 | @@ -22,30 +22,28 @@ |
3024 | import os |
3025 | from textwrap import dedent |
3026 | |
3027 | -import provisioningserver |
3028 | -from provisioningserver.boot import BootMethodRegistry |
3029 | -from provisioningserver.boot.tftppath import list_boot_images |
3030 | -from provisioningserver.config import BootSources |
3031 | -from provisioningserver.import_images.cleanup import ( |
3032 | - cleanup_snapshots_and_cache, |
3033 | -) |
3034 | -from provisioningserver.import_images.download_descriptions import ( |
3035 | +import maascluster |
3036 | +from maascluster.boot import BootMethodRegistry |
3037 | +from maascluster.boot.tftppath import list_boot_images |
3038 | +from maascluster.config import BootSources |
3039 | +from maascluster.import_images.cleanup import cleanup_snapshots_and_cache |
3040 | +from maascluster.import_images.download_descriptions import ( |
3041 | download_all_image_descriptions, |
3042 | ) |
3043 | -from provisioningserver.import_images.download_resources import ( |
3044 | +from maascluster.import_images.download_resources import ( |
3045 | download_all_boot_resources, |
3046 | ) |
3047 | -from provisioningserver.import_images.helpers import maaslog |
3048 | -from provisioningserver.import_images.keyrings import write_all_keyrings |
3049 | -from provisioningserver.import_images.product_mapping import map_products |
3050 | -from provisioningserver.utils import get_cluster_config |
3051 | -from provisioningserver.utils.fs import ( |
3052 | +from maascluster.import_images.helpers import maaslog |
3053 | +from maascluster.import_images.keyrings import write_all_keyrings |
3054 | +from maascluster.import_images.product_mapping import map_products |
3055 | +from maascluster.utils import get_cluster_config |
3056 | +from maascluster.utils.fs import ( |
3057 | atomic_symlink, |
3058 | atomic_write, |
3059 | read_text_file, |
3060 | tempdir, |
3061 | ) |
3062 | -from provisioningserver.utils.shell import call_and_check |
3063 | +from maascluster.utils.shell import call_and_check |
3064 | |
3065 | |
3066 | class NoConfigFile(Exception): |
3067 | @@ -245,7 +243,7 @@ |
3068 | "any boot images available.") |
3069 | return |
3070 | |
3071 | - storage = provisioningserver.config.BOOT_RESOURCES_STORAGE |
3072 | + storage = maascluster.config.BOOT_RESOURCES_STORAGE |
3073 | meta_file_content = image_descriptions.dump_json() |
3074 | if meta_contains(storage, meta_file_content): |
3075 | maaslog.info( |
3076 | @@ -303,11 +301,11 @@ |
3077 | from sys import stderr |
3078 | import traceback |
3079 | |
3080 | - from provisioningserver import services |
3081 | - from provisioningserver.rpc import getRegionClient |
3082 | - from provisioningserver.rpc.clusterservice import ClusterClientService |
3083 | - from provisioningserver.rpc.exceptions import NoConnectionsAvailable |
3084 | - from provisioningserver.utils.twisted import retries, pause |
3085 | + from maascluster import services |
3086 | + from maascluster.rpc import getRegionClient |
3087 | + from maascluster.rpc.clusterservice import ClusterClientService |
3088 | + from maascluster.rpc.exceptions import NoConnectionsAvailable |
3089 | + from maascluster.utils.twisted import retries, pause |
3090 | from twisted.internet import reactor |
3091 | from twisted.internet.defer import inlineCallbacks |
3092 | from twisted.internet.threads import deferToThread |
3093 | |
3094 | === modified file 'src/maascluster/import_images/download_descriptions.py' |
3095 | --- src/provisioningserver/import_images/download_descriptions.py 2015-03-25 15:33:23 +0000 |
3096 | +++ src/maascluster/import_images/download_descriptions.py 2015-05-01 07:23:47 +0000 |
3097 | @@ -22,10 +22,8 @@ |
3098 | ] |
3099 | |
3100 | |
3101 | -from provisioningserver.import_images.boot_image_mapping import ( |
3102 | - BootImageMapping, |
3103 | -) |
3104 | -from provisioningserver.import_images.helpers import ( |
3105 | +from maascluster.import_images.boot_image_mapping import BootImageMapping |
3106 | +from maascluster.import_images.helpers import ( |
3107 | get_os_from_product, |
3108 | get_signing_policy, |
3109 | ImageSpec, |
3110 | |
3111 | === modified file 'src/maascluster/import_images/download_resources.py' |
3112 | --- src/provisioningserver/import_images/download_resources.py 2015-03-25 15:33:23 +0000 |
3113 | +++ src/maascluster/import_images/download_resources.py 2015-05-01 07:23:47 +0000 |
3114 | @@ -20,13 +20,13 @@ |
3115 | from gzip import GzipFile |
3116 | import os.path |
3117 | |
3118 | -from provisioningserver.import_images.helpers import ( |
3119 | +from maascluster.import_images.helpers import ( |
3120 | get_os_from_product, |
3121 | get_signing_policy, |
3122 | maaslog, |
3123 | ) |
3124 | -from provisioningserver.utils import in_develop_mode |
3125 | -from provisioningserver.utils.shell import call_and_check |
3126 | +from maascluster.utils import in_develop_mode |
3127 | +from maascluster.utils.shell import call_and_check |
3128 | from simplestreams.contentsource import FdContentSource |
3129 | from simplestreams.mirrors import ( |
3130 | BasicMirrorWriter, |
3131 | |
3132 | === modified file 'src/maascluster/import_images/helpers.py' |
3133 | --- src/provisioningserver/import_images/helpers.py 2014-08-20 19:04:17 +0000 |
3134 | +++ src/maascluster/import_images/helpers.py 2015-05-01 07:23:47 +0000 |
3135 | @@ -22,7 +22,7 @@ |
3136 | from collections import namedtuple |
3137 | import functools |
3138 | |
3139 | -from provisioningserver.logger import get_maas_logger |
3140 | +from maascluster.logger import get_maas_logger |
3141 | from simplestreams.util import policy_read_signed |
3142 | |
3143 | # A tuple of the items that together select a boot image. |
3144 | |
3145 | === modified file 'src/maascluster/import_images/keyrings.py' |
3146 | --- src/provisioningserver/import_images/keyrings.py 2014-09-10 16:20:31 +0000 |
3147 | +++ src/maascluster/import_images/keyrings.py 2015-05-01 07:23:47 +0000 |
3148 | @@ -18,7 +18,7 @@ |
3149 | import os |
3150 | from urlparse import urlsplit |
3151 | |
3152 | -from provisioningserver.import_images.helpers import maaslog |
3153 | +from maascluster.import_images.helpers import maaslog |
3154 | |
3155 | |
3156 | def write_keyring(keyring_path, keyring_data): |
3157 | |
3158 | === modified file 'src/maascluster/import_images/testing/factory.py' |
3159 | --- src/provisioningserver/import_images/testing/factory.py 2015-03-25 15:33:23 +0000 |
3160 | +++ src/maascluster/import_images/testing/factory.py 2015-05-01 07:23:47 +0000 |
3161 | @@ -22,11 +22,9 @@ |
3162 | |
3163 | from textwrap import dedent |
3164 | |
3165 | +from maascluster.import_images.boot_image_mapping import BootImageMapping |
3166 | +from maascluster.import_images.helpers import ImageSpec |
3167 | from maastesting.factory import factory |
3168 | -from provisioningserver.import_images.boot_image_mapping import ( |
3169 | - BootImageMapping, |
3170 | -) |
3171 | -from provisioningserver.import_images.helpers import ImageSpec |
3172 | |
3173 | |
3174 | def make_maas_meta(): |
3175 | |
3176 | === modified file 'src/maascluster/import_images/tests/test_boot_image_mapping.py' |
3177 | --- src/provisioningserver/import_images/tests/test_boot_image_mapping.py 2015-03-25 15:33:23 +0000 |
3178 | +++ src/maascluster/import_images/tests/test_boot_image_mapping.py 2015-05-01 07:23:47 +0000 |
3179 | @@ -16,17 +16,15 @@ |
3180 | |
3181 | import json |
3182 | |
3183 | -from maastesting.factory import factory |
3184 | -from maastesting.testcase import MAASTestCase |
3185 | -from provisioningserver.import_images.boot_image_mapping import ( |
3186 | - BootImageMapping, |
3187 | -) |
3188 | -from provisioningserver.import_images.testing.factory import ( |
3189 | +from maascluster.import_images.boot_image_mapping import BootImageMapping |
3190 | +from maascluster.import_images.testing.factory import ( |
3191 | make_image_spec, |
3192 | make_maas_meta, |
3193 | make_maas_meta_without_os, |
3194 | set_resource, |
3195 | ) |
3196 | +from maastesting.factory import factory |
3197 | +from maastesting.testcase import MAASTestCase |
3198 | |
3199 | |
3200 | class TestBootImageMapping(MAASTestCase): |
3201 | |
3202 | === modified file 'src/maascluster/import_images/tests/test_boot_resources.py' |
3203 | --- src/provisioningserver/import_images/tests/test_boot_resources.py 2015-03-25 15:33:23 +0000 |
3204 | +++ src/maascluster/import_images/tests/test_boot_resources.py 2015-05-01 07:23:47 +0000 |
3205 | @@ -28,6 +28,14 @@ |
3206 | Popen, |
3207 | ) |
3208 | |
3209 | +from maascluster.boot import BootMethodRegistry |
3210 | +import maascluster.config |
3211 | +from maascluster.config import BootSources |
3212 | +from maascluster.import_images import boot_resources |
3213 | +from maascluster.import_images.boot_image_mapping import BootImageMapping |
3214 | +from maascluster.import_images.testing.factory import make_image_spec |
3215 | +from maascluster.testing.config import BootSourcesFixture |
3216 | +from maascluster.utils.fs import write_text_file |
3217 | from maastesting.factory import factory |
3218 | from maastesting.matchers import ( |
3219 | MockAnyCall, |
3220 | @@ -38,16 +46,6 @@ |
3221 | from maastesting.utils import age_file |
3222 | import mock |
3223 | from mock import call |
3224 | -from provisioningserver.boot import BootMethodRegistry |
3225 | -import provisioningserver.config |
3226 | -from provisioningserver.config import BootSources |
3227 | -from provisioningserver.import_images import boot_resources |
3228 | -from provisioningserver.import_images.boot_image_mapping import ( |
3229 | - BootImageMapping, |
3230 | -) |
3231 | -from provisioningserver.import_images.testing.factory import make_image_spec |
3232 | -from provisioningserver.testing.config import BootSourcesFixture |
3233 | -from provisioningserver.utils.fs import write_text_file |
3234 | from testtools.content import Content |
3235 | from testtools.content_type import UTF8_TEXT |
3236 | from testtools.matchers import ( |
3237 | @@ -138,7 +136,7 @@ |
3238 | |
3239 | # Make the choice of provisional symlink less random, so that we can |
3240 | # match against what's happening. |
3241 | - from provisioningserver.utils import fs |
3242 | + from maascluster.utils import fs |
3243 | randint = self.patch_autospec(fs, "randint") |
3244 | randint.side_effect = lambda a, b: randint.call_count |
3245 | |
3246 | @@ -197,7 +195,7 @@ |
3247 | super(TestMain, self).setUp() |
3248 | self.storage = self.make_dir() |
3249 | self.patch( |
3250 | - provisioningserver.config, 'BOOT_RESOURCES_STORAGE', self.storage) |
3251 | + maascluster.config, 'BOOT_RESOURCES_STORAGE', self.storage) |
3252 | # Forcing arch to amd64 causes pxelinux.0 to be installed, giving more |
3253 | # test coverage. |
3254 | self.image = make_image_spec(arch='amd64') |
3255 | |
3256 | === modified file 'src/maascluster/import_images/tests/test_cleanup.py' |
3257 | --- src/provisioningserver/import_images/tests/test_cleanup.py 2014-09-23 15:31:33 +0000 |
3258 | +++ src/maascluster/import_images/tests/test_cleanup.py 2015-05-01 07:23:47 +0000 |
3259 | @@ -17,10 +17,10 @@ |
3260 | import os |
3261 | from random import randint |
3262 | |
3263 | +from maascluster.import_images import cleanup |
3264 | from maastesting.factory import factory |
3265 | from maastesting.matchers import MockCalledOnceWith |
3266 | from maastesting.testcase import MAASTestCase |
3267 | -from provisioningserver.import_images import cleanup |
3268 | |
3269 | |
3270 | class TestCleanup(MAASTestCase): |
3271 | |
3272 | === modified file 'src/maascluster/import_images/tests/test_download_descriptions.py' |
3273 | --- src/provisioningserver/import_images/tests/test_download_descriptions.py 2015-03-25 15:33:23 +0000 |
3274 | +++ src/maascluster/import_images/tests/test_download_descriptions.py 2015-05-01 07:23:47 +0000 |
3275 | @@ -14,21 +14,19 @@ |
3276 | __metaclass__ = type |
3277 | __all__ = [] |
3278 | |
3279 | -from maastesting.factory import factory |
3280 | -from maastesting.testcase import MAASTestCase |
3281 | -from mock import sentinel |
3282 | -from provisioningserver.import_images import download_descriptions |
3283 | -from provisioningserver.import_images.boot_image_mapping import ( |
3284 | - BootImageMapping, |
3285 | -) |
3286 | -from provisioningserver.import_images.download_descriptions import ( |
3287 | +from maascluster.import_images import download_descriptions |
3288 | +from maascluster.import_images.boot_image_mapping import BootImageMapping |
3289 | +from maascluster.import_images.download_descriptions import ( |
3290 | clean_up_repo_item, |
3291 | RepoDumper, |
3292 | ) |
3293 | -from provisioningserver.import_images.testing.factory import ( |
3294 | +from maascluster.import_images.testing.factory import ( |
3295 | make_image_spec, |
3296 | set_resource, |
3297 | ) |
3298 | +from maastesting.factory import factory |
3299 | +from maastesting.testcase import MAASTestCase |
3300 | +from mock import sentinel |
3301 | |
3302 | |
3303 | class TestValuePassesFilterList(MAASTestCase): |
3304 | |
3305 | === modified file 'src/maascluster/import_images/tests/test_download_resources.py' |
3306 | --- src/provisioningserver/import_images/tests/test_download_resources.py 2014-08-20 19:04:17 +0000 |
3307 | +++ src/maascluster/import_images/tests/test_download_resources.py 2015-05-01 07:23:47 +0000 |
3308 | @@ -1,7 +1,7 @@ |
3309 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
3310 | # GNU Affero General Public License version 3 (see the file LICENSE). |
3311 | |
3312 | -"""Tests for `provisioningserver.import_images.download_resources`.""" |
3313 | +"""Tests for `maascluster.import_images.download_resources`.""" |
3314 | |
3315 | from __future__ import ( |
3316 | absolute_import, |
3317 | @@ -17,11 +17,11 @@ |
3318 | from datetime import datetime |
3319 | import os |
3320 | |
3321 | +from maascluster.import_images import download_resources |
3322 | +from maascluster.import_images.product_mapping import ProductMapping |
3323 | from maastesting.matchers import MockCalledWith |
3324 | from maastesting.testcase import MAASTestCase |
3325 | import mock |
3326 | -from provisioningserver.import_images import download_resources |
3327 | -from provisioningserver.import_images.product_mapping import ProductMapping |
3328 | from simplestreams.objectstores import FileStore |
3329 | |
3330 | |
3331 | |
3332 | === modified file 'src/maascluster/import_images/tests/test_helpers.py' |
3333 | --- src/provisioningserver/import_images/tests/test_helpers.py 2014-08-18 20:01:49 +0000 |
3334 | +++ src/maascluster/import_images/tests/test_helpers.py 2015-05-01 07:23:47 +0000 |
3335 | @@ -14,11 +14,11 @@ |
3336 | __metaclass__ = type |
3337 | __all__ = [] |
3338 | |
3339 | +from maascluster.import_images import helpers |
3340 | from maastesting.factory import factory |
3341 | from maastesting.matchers import MockCalledOnceWith |
3342 | from maastesting.testcase import MAASTestCase |
3343 | import mock |
3344 | -from provisioningserver.import_images import helpers |
3345 | from simplestreams.util import SignatureMissingException |
3346 | |
3347 | |
3348 | |
3349 | === modified file 'src/maascluster/import_images/tests/test_keyrings.py' |
3350 | --- src/provisioningserver/import_images/tests/test_keyrings.py 2015-03-25 15:33:23 +0000 |
3351 | +++ src/maascluster/import_images/tests/test_keyrings.py 2015-05-01 07:23:47 +0000 |
3352 | @@ -15,6 +15,7 @@ |
3353 | |
3354 | import os |
3355 | |
3356 | +from maascluster.import_images import keyrings |
3357 | from maastesting.factory import factory |
3358 | from maastesting.matchers import ( |
3359 | MockCalledWith, |
3360 | @@ -22,7 +23,6 @@ |
3361 | ) |
3362 | from maastesting.testcase import MAASTestCase |
3363 | import mock |
3364 | -from provisioningserver.import_images import keyrings |
3365 | from testtools.matchers import FileContains |
3366 | |
3367 | |
3368 | |
3369 | === modified file 'src/maascluster/import_images/tests/test_product_mapping.py' |
3370 | --- src/provisioningserver/import_images/tests/test_product_mapping.py 2015-03-25 15:33:23 +0000 |
3371 | +++ src/maascluster/import_images/tests/test_product_mapping.py 2015-05-01 07:23:47 +0000 |
3372 | @@ -14,20 +14,18 @@ |
3373 | __metaclass__ = type |
3374 | __all__ = [] |
3375 | |
3376 | -from maastesting.factory import factory |
3377 | -from maastesting.testcase import MAASTestCase |
3378 | -from provisioningserver.import_images.boot_image_mapping import ( |
3379 | - BootImageMapping, |
3380 | -) |
3381 | -from provisioningserver.import_images.product_mapping import ( |
3382 | +from maascluster.import_images.boot_image_mapping import BootImageMapping |
3383 | +from maascluster.import_images.product_mapping import ( |
3384 | map_products, |
3385 | ProductMapping, |
3386 | ) |
3387 | -from provisioningserver.import_images.testing.factory import ( |
3388 | +from maascluster.import_images.testing.factory import ( |
3389 | make_boot_resource, |
3390 | make_image_spec, |
3391 | set_resource, |
3392 | ) |
3393 | +from maastesting.factory import factory |
3394 | +from maastesting.testcase import MAASTestCase |
3395 | |
3396 | |
3397 | class TestProductMapping(MAASTestCase): |
3398 | |
3399 | === modified file 'src/maascluster/import_images/tests/test_uec2roottar.py' |
3400 | --- src/provisioningserver/import_images/tests/test_uec2roottar.py 2015-03-25 15:33:23 +0000 |
3401 | +++ src/maascluster/import_images/tests/test_uec2roottar.py 2015-05-01 07:23:47 +0000 |
3402 | @@ -18,6 +18,7 @@ |
3403 | import os.path |
3404 | from subprocess import CalledProcessError |
3405 | |
3406 | +from maascluster.import_images import uec2roottar |
3407 | from maastesting.factory import factory |
3408 | from maastesting.matchers import ( |
3409 | MockAnyCall, |
3410 | @@ -26,7 +27,6 @@ |
3411 | ) |
3412 | from maastesting.testcase import MAASTestCase |
3413 | import mock |
3414 | -from provisioningserver.import_images import uec2roottar |
3415 | from testtools.matchers import HasLength |
3416 | from testtools.testcase import ExpectedException |
3417 | |
3418 | |
3419 | === modified file 'src/maascluster/import_images/uec2roottar.py' |
3420 | --- src/provisioningserver/import_images/uec2roottar.py 2015-03-25 15:33:23 +0000 |
3421 | +++ src/maascluster/import_images/uec2roottar.py 2015-05-01 07:23:47 +0000 |
3422 | @@ -26,9 +26,9 @@ |
3423 | check_output, |
3424 | ) |
3425 | |
3426 | -from provisioningserver.logger import get_maas_logger |
3427 | -from provisioningserver.utils.env import environment_variables |
3428 | -from provisioningserver.utils.fs import tempdir |
3429 | +from maascluster.logger import get_maas_logger |
3430 | +from maascluster.utils.env import environment_variables |
3431 | +from maascluster.utils.fs import tempdir |
3432 | |
3433 | |
3434 | maaslog = get_maas_logger("uec2roottar") |
3435 | |
3436 | === modified file 'src/maascluster/kernel_opts.py' |
3437 | --- src/provisioningserver/kernel_opts.py 2014-06-20 13:38:39 +0000 |
3438 | +++ src/maascluster/kernel_opts.py 2015-05-01 07:23:47 +0000 |
3439 | @@ -21,7 +21,7 @@ |
3440 | from collections import namedtuple |
3441 | import os |
3442 | |
3443 | -from provisioningserver.drivers import ArchitectureRegistry |
3444 | +from maascluster.drivers import ArchitectureRegistry |
3445 | |
3446 | |
3447 | class EphemeralImagesDirectoryNotFound(Exception): |
3448 | |
3449 | === modified file 'src/maascluster/logger/__init__.py' |
3450 | --- src/provisioningserver/logger/__init__.py 2014-11-06 13:00:27 +0000 |
3451 | +++ src/maascluster/logger/__init__.py 2015-05-01 07:23:47 +0000 |
3452 | @@ -1,6 +1,6 @@ |
3453 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
3454 | # GNU Affero General Public License version 3 (see the file LICENSE). |
3455 | -"""__init__ for the provisioningserver.logger package.""" |
3456 | +"""__init__ for the maascluster.logger package.""" |
3457 | |
3458 | from __future__ import ( |
3459 | absolute_import, |
3460 | @@ -22,7 +22,7 @@ |
3461 | import logging |
3462 | import sys |
3463 | |
3464 | -from provisioningserver.logger.log import get_maas_logger |
3465 | +from maascluster.logger.log import get_maas_logger |
3466 | from twisted.python import log |
3467 | |
3468 | # This format roughly matches Twisted's default, so that combined Twisted and |
3469 | |
3470 | === modified file 'src/maascluster/logger/tests/test_logger.py' |
3471 | --- src/provisioningserver/logger/tests/test_logger.py 2015-03-25 15:33:23 +0000 |
3472 | +++ src/maascluster/logger/tests/test_logger.py 2015-05-01 07:23:47 +0000 |
3473 | @@ -18,13 +18,13 @@ |
3474 | import logging |
3475 | import logging.handlers |
3476 | |
3477 | -from maastesting.factory import factory |
3478 | -from provisioningserver.logger import log |
3479 | -from provisioningserver.logger.log import ( |
3480 | +from maascluster.logger import log |
3481 | +from maascluster.logger.log import ( |
3482 | get_maas_logger, |
3483 | MAASLogger, |
3484 | ) |
3485 | -from provisioningserver.testing.testcase import PservTestCase |
3486 | +from maascluster.testing.testcase import PservTestCase |
3487 | +from maastesting.factory import factory |
3488 | from testtools.matchers import ( |
3489 | HasLength, |
3490 | IsInstance, |
3491 | |
3492 | === modified file 'src/maascluster/network.py' |
3493 | --- src/provisioningserver/network.py 2015-03-25 15:33:23 +0000 |
3494 | +++ src/maascluster/network.py 2015-05-01 07:23:47 +0000 |
3495 | @@ -23,6 +23,7 @@ |
3496 | from itertools import chain |
3497 | from operator import attrgetter |
3498 | |
3499 | +from maascluster.utils.network import clean_up_netifaces_address |
3500 | from netaddr import ( |
3501 | IPAddress, |
3502 | IPNetwork, |
3503 | @@ -33,7 +34,6 @@ |
3504 | ifaddresses, |
3505 | interfaces, |
3506 | ) |
3507 | -from provisioningserver.utils.network import clean_up_netifaces_address |
3508 | |
3509 | |
3510 | class AttachedNetwork: |
3511 | |
3512 | === modified file 'src/maascluster/path.py' |
3513 | --- src/provisioningserver/path.py 2015-03-05 22:07:21 +0000 |
3514 | +++ src/maascluster/path.py 2015-05-01 07:23:47 +0000 |
3515 | @@ -19,7 +19,7 @@ |
3516 | |
3517 | import os |
3518 | |
3519 | -from provisioningserver.utils.fs import ensure_dir |
3520 | +from maascluster.utils.fs import ensure_dir |
3521 | |
3522 | |
3523 | def get_tentative_path(*path_elements): |
3524 | |
3525 | === modified file 'src/maascluster/plugin.py' |
3526 | --- src/provisioningserver/plugin.py 2015-04-29 06:19:04 +0000 |
3527 | +++ src/maascluster/plugin.py 2015-05-01 07:23:47 +0000 |
3528 | @@ -21,9 +21,7 @@ |
3529 | import socket |
3530 | from socket import error as socket_error |
3531 | |
3532 | -from provisioningserver.utils.debug import ( |
3533 | - register_sigusr2_thread_dump_handler, |
3534 | -) |
3535 | +from maascluster.utils.debug import register_sigusr2_thread_dump_handler |
3536 | from twisted.application.internet import TCPServer |
3537 | from twisted.application.service import IServiceMaker |
3538 | from twisted.cred.checkers import ICredentialsChecker |
3539 | @@ -84,8 +82,8 @@ |
3540 | |
3541 | |
3542 | def serverFromString(description): |
3543 | - """Lazy import from `provisioningserver.utils.introspect`.""" |
3544 | - from provisioningserver.utils import introspect |
3545 | + """Lazy import from `maascluster.utils.introspect`.""" |
3546 | + from maascluster.utils import introspect |
3547 | return introspect.serverFromString(description) |
3548 | |
3549 | |
3550 | @@ -125,10 +123,10 @@ |
3551 | return site_service |
3552 | |
3553 | def _makeImageService(self): |
3554 | - from provisioningserver.pserv_services.image import ( |
3555 | + from maascluster.pserv_services.image import ( |
3556 | BootImageEndpointService) |
3557 | from twisted.internet.endpoints import AdoptedStreamServerEndpoint |
3558 | - from provisioningserver import config |
3559 | + from maascluster import config |
3560 | |
3561 | port = 5248 # config["port"] |
3562 | # Make a socket with SO_REUSEPORT set so that we can run multiple we |
3563 | @@ -165,7 +163,7 @@ |
3564 | |
3565 | def _makeTFTPService(self, tftp_config): |
3566 | """Create the dynamic TFTP service.""" |
3567 | - from provisioningserver.pserv_services.tftp import TFTPService |
3568 | + from maascluster.pserv_services.tftp import TFTPService |
3569 | tftp_service = TFTPService( |
3570 | resource_root=tftp_config['resource_root'], |
3571 | port=tftp_config['port'], generator=tftp_config['generator']) |
3572 | @@ -173,8 +171,8 @@ |
3573 | return tftp_service |
3574 | |
3575 | def _makeImageDownloadService(self, rpc_service): |
3576 | - from provisioningserver.cluster_config import get_cluster_uuid |
3577 | - from provisioningserver.pserv_services.image_download_service \ |
3578 | + from maascluster.cluster_config import get_cluster_uuid |
3579 | + from maascluster.pserv_services.image_download_service \ |
3580 | import ImageDownloadService |
3581 | image_download_service = ImageDownloadService( |
3582 | rpc_service, reactor, get_cluster_uuid()) |
3583 | @@ -182,8 +180,8 @@ |
3584 | return image_download_service |
3585 | |
3586 | def _makeLeaseUploadService(self, rpc_service): |
3587 | - from provisioningserver.cluster_config import get_cluster_uuid |
3588 | - from provisioningserver.pserv_services.lease_upload_service \ |
3589 | + from maascluster.cluster_config import get_cluster_uuid |
3590 | + from maascluster.pserv_services.lease_upload_service \ |
3591 | import LeaseUploadService |
3592 | lease_upload_service = LeaseUploadService( |
3593 | rpc_service, reactor, get_cluster_uuid()) |
3594 | @@ -191,22 +189,22 @@ |
3595 | return lease_upload_service |
3596 | |
3597 | def _makeNodePowerMonitorService(self): |
3598 | - from provisioningserver.cluster_config import get_cluster_uuid |
3599 | - from provisioningserver.pserv_services.node_power_monitor_service \ |
3600 | + from maascluster.cluster_config import get_cluster_uuid |
3601 | + from maascluster.pserv_services.node_power_monitor_service \ |
3602 | import NodePowerMonitorService |
3603 | node_monitor = NodePowerMonitorService(get_cluster_uuid(), reactor) |
3604 | node_monitor.setName("node_monitor") |
3605 | return node_monitor |
3606 | |
3607 | def _makeRPCService(self, rpc_config): |
3608 | - from provisioningserver.rpc.clusterservice import ClusterClientService |
3609 | + from maascluster.rpc.clusterservice import ClusterClientService |
3610 | rpc_service = ClusterClientService(reactor) |
3611 | rpc_service.setName("rpc") |
3612 | return rpc_service |
3613 | |
3614 | def _makeDHCPProbeService(self, rpc_service): |
3615 | - from provisioningserver.cluster_config import get_cluster_uuid |
3616 | - from provisioningserver.pserv_services.dhcp_probe_service \ |
3617 | + from maascluster.cluster_config import get_cluster_uuid |
3618 | + from maascluster.pserv_services.dhcp_probe_service \ |
3619 | import DHCPProbeService |
3620 | dhcp_probe_service = DHCPProbeService( |
3621 | rpc_service, reactor, get_cluster_uuid()) |
3622 | @@ -214,7 +212,7 @@ |
3623 | return dhcp_probe_service |
3624 | |
3625 | def _makeIntrospectionService(self, endpoint): |
3626 | - from provisioningserver.utils import introspect |
3627 | + from maascluster.utils import introspect |
3628 | introspect_service = ( |
3629 | introspect.IntrospectionShellService( |
3630 | location="cluster", endpoint=endpoint, namespace={})) |
3631 | @@ -225,8 +223,8 @@ |
3632 | """Construct the MAAS Cluster service.""" |
3633 | register_sigusr2_thread_dump_handler() |
3634 | |
3635 | - from provisioningserver import services |
3636 | - from provisioningserver.config import Config |
3637 | + from maascluster import services |
3638 | + from maascluster.config import Config |
3639 | |
3640 | config = Config.load(options["config-file"]) |
3641 | |
3642 | |
3643 | === modified file 'src/maascluster/power/poweraction.py' |
3644 | --- src/provisioningserver/power/poweraction.py 2015-04-23 21:12:53 +0000 |
3645 | +++ src/maascluster/power/poweraction.py 2015-05-01 07:23:47 +0000 |
3646 | @@ -22,12 +22,12 @@ |
3647 | import os |
3648 | import subprocess |
3649 | |
3650 | -from provisioningserver.utils import ( |
3651 | +from maascluster.utils import ( |
3652 | escape_py_literal, |
3653 | locate_config, |
3654 | ShellTemplate, |
3655 | ) |
3656 | -from provisioningserver.utils.network import find_ip_via_arp |
3657 | +from maascluster.utils.network import find_ip_via_arp |
3658 | |
3659 | |
3660 | class UnknownPowerType(Exception): |
3661 | |
3662 | === modified file 'src/maascluster/power/tests/test_poweraction.py' |
3663 | --- src/provisioningserver/power/tests/test_poweraction.py 2015-04-23 21:12:53 +0000 |
3664 | +++ src/maascluster/power/tests/test_poweraction.py 2015-05-01 07:23:47 +0000 |
3665 | @@ -1,7 +1,7 @@ |
3666 | # Copyright 2012-2014 Canonical Ltd. This software is licensed under the |
3667 | # GNU Affero General Public License version 3 (see the file LICENSE). |
3668 | |
3669 | -"""Tests for `provisioningserver.power`. |
3670 | +"""Tests for `maascluster.power`. |
3671 | """ |
3672 | |
3673 | from __future__ import ( |
3674 | @@ -19,6 +19,17 @@ |
3675 | from random import randint |
3676 | import re |
3677 | |
3678 | +import maascluster.power.poweraction |
3679 | +from maascluster.power.poweraction import ( |
3680 | + PowerAction, |
3681 | + PowerActionFail, |
3682 | + UnknownPowerType, |
3683 | +) |
3684 | +from maascluster.utils import ( |
3685 | + escape_py_literal, |
3686 | + locate_config, |
3687 | + ShellTemplate, |
3688 | +) |
3689 | from maastesting.factory import factory |
3690 | from maastesting.matchers import MockCalledOnceWith |
3691 | from maastesting.testcase import ( |
3692 | @@ -30,17 +41,6 @@ |
3693 | Mock, |
3694 | sentinel, |
3695 | ) |
3696 | -import provisioningserver.power.poweraction |
3697 | -from provisioningserver.power.poweraction import ( |
3698 | - PowerAction, |
3699 | - PowerActionFail, |
3700 | - UnknownPowerType, |
3701 | -) |
3702 | -from provisioningserver.utils import ( |
3703 | - escape_py_literal, |
3704 | - locate_config, |
3705 | - ShellTemplate, |
3706 | -) |
3707 | from testtools.matchers import ( |
3708 | FileContains, |
3709 | MatchesException, |
3710 | @@ -324,7 +324,7 @@ |
3711 | |
3712 | def test_execute_looks_up_ip_address_from_mac_address(self): |
3713 | find_ip_via_arp = self.patch( |
3714 | - provisioningserver.power.poweraction, "find_ip_via_arp") |
3715 | + maascluster.power.poweraction, "find_ip_via_arp") |
3716 | find_ip_via_arp.return_value = sentinel.ip_address_from_mac |
3717 | |
3718 | power_action = self.make_stubbed_power_action() |
3719 | |
3720 | === modified file 'src/maascluster/pserv_services/dhcp_probe_service.py' |
3721 | --- src/provisioningserver/pserv_services/dhcp_probe_service.py 2015-03-25 15:33:23 +0000 |
3722 | +++ src/maascluster/pserv_services/dhcp_probe_service.py 2015-05-01 07:23:47 +0000 |
3723 | @@ -20,14 +20,14 @@ |
3724 | from datetime import timedelta |
3725 | import socket |
3726 | |
3727 | -from provisioningserver.dhcp.detect import probe_interface |
3728 | -from provisioningserver.logger.log import get_maas_logger |
3729 | -from provisioningserver.rpc.exceptions import NoConnectionsAvailable |
3730 | -from provisioningserver.rpc.region import ( |
3731 | +from maascluster.dhcp.detect import probe_interface |
3732 | +from maascluster.logger.log import get_maas_logger |
3733 | +from maascluster.rpc.exceptions import NoConnectionsAvailable |
3734 | +from maascluster.rpc.region import ( |
3735 | GetClusterInterfaces, |
3736 | ReportForeignDHCPServer, |
3737 | ) |
3738 | -from provisioningserver.utils.twisted import ( |
3739 | +from maascluster.utils.twisted import ( |
3740 | pause, |
3741 | retries, |
3742 | ) |
3743 | |
3744 | === modified file 'src/maascluster/pserv_services/image_download_service.py' |
3745 | --- src/provisioningserver/pserv_services/image_download_service.py 2015-04-28 11:42:55 +0000 |
3746 | +++ src/maascluster/pserv_services/image_download_service.py 2015-05-01 07:23:47 +0000 |
3747 | @@ -19,16 +19,16 @@ |
3748 | |
3749 | from datetime import timedelta |
3750 | |
3751 | -from provisioningserver.boot import tftppath |
3752 | -from provisioningserver.logger import get_maas_logger |
3753 | -from provisioningserver.rpc.boot_images import import_boot_images |
3754 | -from provisioningserver.rpc.exceptions import NoConnectionsAvailable |
3755 | -from provisioningserver.rpc.region import ( |
3756 | +from maascluster.boot import tftppath |
3757 | +from maascluster.logger import get_maas_logger |
3758 | +from maascluster.rpc.boot_images import import_boot_images |
3759 | +from maascluster.rpc.exceptions import NoConnectionsAvailable |
3760 | +from maascluster.rpc.region import ( |
3761 | GetBootSources, |
3762 | GetBootSourcesV2, |
3763 | GetProxies, |
3764 | ) |
3765 | -from provisioningserver.utils.twisted import ( |
3766 | +from maascluster.utils.twisted import ( |
3767 | pause, |
3768 | retries, |
3769 | ) |
3770 | |
3771 | === modified file 'src/maascluster/pserv_services/lease_upload_service.py' |
3772 | --- src/provisioningserver/pserv_services/lease_upload_service.py 2015-03-25 15:33:23 +0000 |
3773 | +++ src/maascluster/pserv_services/lease_upload_service.py 2015-05-01 07:23:47 +0000 |
3774 | @@ -19,14 +19,14 @@ |
3775 | ] |
3776 | |
3777 | |
3778 | -from provisioningserver.dhcp.leases import ( |
3779 | +from maascluster.dhcp.leases import ( |
3780 | check_lease_changes, |
3781 | record_lease_state, |
3782 | ) |
3783 | -from provisioningserver.logger import get_maas_logger |
3784 | -from provisioningserver.rpc.exceptions import NoConnectionsAvailable |
3785 | -from provisioningserver.rpc.region import UpdateLeases |
3786 | -from provisioningserver.utils.twisted import ( |
3787 | +from maascluster.logger import get_maas_logger |
3788 | +from maascluster.rpc.exceptions import NoConnectionsAvailable |
3789 | +from maascluster.rpc.region import UpdateLeases |
3790 | +from maascluster.utils.twisted import ( |
3791 | pause, |
3792 | retries, |
3793 | ) |
3794 | |
3795 | === modified file 'src/maascluster/pserv_services/node_power_monitor_service.py' |
3796 | --- src/provisioningserver/pserv_services/node_power_monitor_service.py 2015-03-25 15:33:23 +0000 |
3797 | +++ src/maascluster/pserv_services/node_power_monitor_service.py 2015-05-01 07:23:47 +0000 |
3798 | @@ -19,15 +19,15 @@ |
3799 | |
3800 | from datetime import timedelta |
3801 | |
3802 | -from provisioningserver.logger.log import get_maas_logger |
3803 | -from provisioningserver.rpc import getRegionClient |
3804 | -from provisioningserver.rpc.exceptions import ( |
3805 | +from maascluster.logger.log import get_maas_logger |
3806 | +from maascluster.rpc import getRegionClient |
3807 | +from maascluster.rpc.exceptions import ( |
3808 | NoConnectionsAvailable, |
3809 | NoSuchCluster, |
3810 | ) |
3811 | -from provisioningserver.rpc.power import query_all_nodes |
3812 | -from provisioningserver.rpc.region import ListNodePowerParameters |
3813 | -from provisioningserver.utils.twisted import ( |
3814 | +from maascluster.rpc.power import query_all_nodes |
3815 | +from maascluster.rpc.region import ListNodePowerParameters |
3816 | +from maascluster.utils.twisted import ( |
3817 | pause, |
3818 | retries, |
3819 | ) |
3820 | |
3821 | === modified file 'src/maascluster/pserv_services/tests/test_dhcp_probe_service.py' |
3822 | --- src/provisioningserver/pserv_services/tests/test_dhcp_probe_service.py 2015-03-25 15:33:23 +0000 |
3823 | +++ src/maascluster/pserv_services/tests/test_dhcp_probe_service.py 2015-05-01 07:23:47 +0000 |
3824 | @@ -15,6 +15,14 @@ |
3825 | __all__ = [] |
3826 | |
3827 | |
3828 | +from maascluster.pserv_services import dhcp_probe_service |
3829 | +from maascluster.pserv_services.dhcp_probe_service import DHCPProbeService |
3830 | +from maascluster.rpc import ( |
3831 | + getRegionClient, |
3832 | + region, |
3833 | +) |
3834 | +from maascluster.rpc.testing import MockLiveClusterToRegionRPCFixture |
3835 | +from maascluster.testing.testcase import PservTestCase |
3836 | from maastesting.factory import factory |
3837 | from maastesting.matchers import ( |
3838 | get_mock_calls, |
3839 | @@ -27,16 +35,6 @@ |
3840 | Mock, |
3841 | sentinel, |
3842 | ) |
3843 | -from provisioningserver.pserv_services import dhcp_probe_service |
3844 | -from provisioningserver.pserv_services.dhcp_probe_service import ( |
3845 | - DHCPProbeService, |
3846 | -) |
3847 | -from provisioningserver.rpc import ( |
3848 | - getRegionClient, |
3849 | - region, |
3850 | -) |
3851 | -from provisioningserver.rpc.testing import MockLiveClusterToRegionRPCFixture |
3852 | -from provisioningserver.testing.testcase import PservTestCase |
3853 | from twisted.internet import defer |
3854 | from twisted.internet.task import Clock |
3855 | |
3856 | |
3857 | === modified file 'src/maascluster/pserv_services/tests/test_image_download_service.py' |
3858 | --- src/provisioningserver/pserv_services/tests/test_image_download_service.py 2015-04-28 11:42:55 +0000 |
3859 | +++ src/maascluster/pserv_services/tests/test_image_download_service.py 2015-05-01 07:23:47 +0000 |
3860 | @@ -1,7 +1,7 @@ |
3861 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
3862 | # GNU Affero General Public License version 3 (see the file LICENSE). |
3863 | |
3864 | -"""Tests for provisioningserver.pserv_services.image_download_service""" |
3865 | +"""Tests for maascluster.pserv_services.image_download_service""" |
3866 | |
3867 | from __future__ import ( |
3868 | absolute_import, |
3869 | @@ -18,6 +18,19 @@ |
3870 | from urlparse import urlparse |
3871 | |
3872 | from fixtures import FakeLogger |
3873 | +from maascluster.boot import tftppath |
3874 | +from maascluster.pserv_services.image_download_service import ( |
3875 | + ImageDownloadService, |
3876 | +) |
3877 | +from maascluster.rpc import boot_images |
3878 | +from maascluster.rpc.boot_images import _run_import |
3879 | +from maascluster.rpc.exceptions import NoConnectionsAvailable |
3880 | +from maascluster.rpc.region import ( |
3881 | + GetBootSources, |
3882 | + GetBootSourcesV2, |
3883 | +) |
3884 | +from maascluster.rpc.testing import TwistedLoggerFixture |
3885 | +from maascluster.testing.testcase import PservTestCase |
3886 | from maastesting.factory import factory |
3887 | from maastesting.matchers import ( |
3888 | get_mock_calls, |
3889 | @@ -31,19 +44,6 @@ |
3890 | Mock, |
3891 | sentinel, |
3892 | ) |
3893 | -from provisioningserver.boot import tftppath |
3894 | -from provisioningserver.pserv_services.image_download_service import ( |
3895 | - ImageDownloadService, |
3896 | -) |
3897 | -from provisioningserver.rpc import boot_images |
3898 | -from provisioningserver.rpc.boot_images import _run_import |
3899 | -from provisioningserver.rpc.exceptions import NoConnectionsAvailable |
3900 | -from provisioningserver.rpc.region import ( |
3901 | - GetBootSources, |
3902 | - GetBootSourcesV2, |
3903 | -) |
3904 | -from provisioningserver.rpc.testing import TwistedLoggerFixture |
3905 | -from provisioningserver.testing.testcase import PservTestCase |
3906 | from testtools.deferredruntest import extract_result |
3907 | from twisted.application.internet import TimerService |
3908 | from twisted.internet import defer |
3909 | |
3910 | === modified file 'src/maascluster/pserv_services/tests/test_lease_upload_service.py' |
3911 | --- src/provisioningserver/pserv_services/tests/test_lease_upload_service.py 2015-03-25 15:33:23 +0000 |
3912 | +++ src/maascluster/pserv_services/tests/test_lease_upload_service.py 2015-05-01 07:23:47 +0000 |
3913 | @@ -1,7 +1,7 @@ |
3914 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
3915 | # GNU Affero General Public License version 3 (see the file LICENSE). |
3916 | |
3917 | -"""Tests for src/provisioningserver/pserv_services/lease_upload_service.py""" |
3918 | +"""Tests for src/maascluster/pserv_services/lease_upload_service.py""" |
3919 | |
3920 | from __future__ import ( |
3921 | absolute_import, |
3922 | @@ -17,6 +17,21 @@ |
3923 | from datetime import datetime |
3924 | |
3925 | from fixtures import FakeLogger |
3926 | +from maascluster import services |
3927 | +from maascluster.dhcp.leases import check_lease_changes |
3928 | +from maascluster.pserv_services import lease_upload_service |
3929 | +from maascluster.pserv_services.lease_upload_service import ( |
3930 | + convert_leases_to_mappings, |
3931 | + convert_mappings_to_leases, |
3932 | + LeaseUploadService, |
3933 | +) |
3934 | +from maascluster.rpc.exceptions import NoConnectionsAvailable |
3935 | +from maascluster.rpc.region import UpdateLeases |
3936 | +from maascluster.rpc.testing import ( |
3937 | + MockClusterToRegionRPCFixture, |
3938 | + TwistedLoggerFixture, |
3939 | +) |
3940 | +from maascluster.testing.testcase import PservTestCase |
3941 | from maastesting.factory import factory |
3942 | from maastesting.matchers import ( |
3943 | MockCalledOnceWith, |
3944 | @@ -29,21 +44,6 @@ |
3945 | Mock, |
3946 | sentinel, |
3947 | ) |
3948 | -from provisioningserver import services |
3949 | -from provisioningserver.dhcp.leases import check_lease_changes |
3950 | -from provisioningserver.pserv_services import lease_upload_service |
3951 | -from provisioningserver.pserv_services.lease_upload_service import ( |
3952 | - convert_leases_to_mappings, |
3953 | - convert_mappings_to_leases, |
3954 | - LeaseUploadService, |
3955 | -) |
3956 | -from provisioningserver.rpc.exceptions import NoConnectionsAvailable |
3957 | -from provisioningserver.rpc.region import UpdateLeases |
3958 | -from provisioningserver.rpc.testing import ( |
3959 | - MockClusterToRegionRPCFixture, |
3960 | - TwistedLoggerFixture, |
3961 | -) |
3962 | -from provisioningserver.testing.testcase import PservTestCase |
3963 | from testtools.deferredruntest import extract_result |
3964 | from twisted.application.internet import TimerService |
3965 | from twisted.internet import defer |
3966 | |
3967 | === modified file 'src/maascluster/pserv_services/tests/test_node_power_monitor_service.py' |
3968 | --- src/provisioningserver/pserv_services/tests/test_node_power_monitor_service.py 2015-03-25 15:33:23 +0000 |
3969 | +++ src/maascluster/pserv_services/tests/test_node_power_monitor_service.py 2015-05-01 07:23:47 +0000 |
3970 | @@ -2,7 +2,7 @@ |
3971 | # GNU Affero General Public License version 3 (see the file LICENSE). |
3972 | |
3973 | """Tests for |
3974 | -:py:module:`~provisioningserver.pserv_services.node_power_monitor_service`.""" |
3975 | +:py:module:`~maascluster.pserv_services.node_power_monitor_service`.""" |
3976 | |
3977 | from __future__ import ( |
3978 | absolute_import, |
3979 | @@ -16,6 +16,15 @@ |
3980 | __all__ = [] |
3981 | |
3982 | from fixtures import FakeLogger |
3983 | +from maascluster.pserv_services import node_power_monitor_service as npms |
3984 | +from maascluster.rpc import ( |
3985 | + exceptions, |
3986 | + region, |
3987 | +) |
3988 | +from maascluster.rpc.testing import ( |
3989 | + MockClusterToRegionRPCFixture, |
3990 | + TwistedLoggerFixture, |
3991 | +) |
3992 | from maastesting.factory import factory |
3993 | from maastesting.matchers import ( |
3994 | MockCalledOnceWith, |
3995 | @@ -29,17 +38,6 @@ |
3996 | ANY, |
3997 | call, |
3998 | ) |
3999 | -from provisioningserver.pserv_services import ( |
4000 | - node_power_monitor_service as npms, |
4001 | -) |
4002 | -from provisioningserver.rpc import ( |
4003 | - exceptions, |
4004 | - region, |
4005 | -) |
4006 | -from provisioningserver.rpc.testing import ( |
4007 | - MockClusterToRegionRPCFixture, |
4008 | - TwistedLoggerFixture, |
4009 | -) |
4010 | from testtools.deferredruntest import extract_result |
4011 | from testtools.matchers import MatchesStructure |
4012 | from twisted.internet.defer import ( |
4013 | |
4014 | === modified file 'src/maascluster/pserv_services/tests/test_tftp.py' |
4015 | --- src/provisioningserver/pserv_services/tests/test_tftp.py 2015-04-24 20:41:48 +0000 |
4016 | +++ src/maascluster/pserv_services/tests/test_tftp.py 2015-05-01 07:23:47 +0000 |
4017 | @@ -31,6 +31,20 @@ |
4018 | ) |
4019 | |
4020 | from fixtures import EnvironmentVariable |
4021 | +from maascluster.boot import BytesReader |
4022 | +from maascluster.boot.pxe import PXEBootMethod |
4023 | +from maascluster.boot.tests.test_pxe import compose_config_path |
4024 | +from maascluster.events import EVENT_TYPES |
4025 | +from maascluster.pserv_services import tftp as tftp_module |
4026 | +from maascluster.pserv_services.tftp import ( |
4027 | + log_request, |
4028 | + Port, |
4029 | + TFTPBackend, |
4030 | + TFTPService, |
4031 | + UDPServer, |
4032 | +) |
4033 | +from maascluster.rpc.testing import TwistedLoggerFixture |
4034 | +from maascluster.tests.test_kernel_opts import make_kernel_parameters |
4035 | from maastesting.factory import factory |
4036 | from maastesting.matchers import ( |
4037 | MockCalledOnceWith, |
4038 | @@ -50,20 +64,6 @@ |
4039 | IPV4_LINK_LOCAL, |
4040 | IPV6_LINK_LOCAL, |
4041 | ) |
4042 | -from provisioningserver.boot import BytesReader |
4043 | -from provisioningserver.boot.pxe import PXEBootMethod |
4044 | -from provisioningserver.boot.tests.test_pxe import compose_config_path |
4045 | -from provisioningserver.events import EVENT_TYPES |
4046 | -from provisioningserver.pserv_services import tftp as tftp_module |
4047 | -from provisioningserver.pserv_services.tftp import ( |
4048 | - log_request, |
4049 | - Port, |
4050 | - TFTPBackend, |
4051 | - TFTPService, |
4052 | - UDPServer, |
4053 | -) |
4054 | -from provisioningserver.rpc.testing import TwistedLoggerFixture |
4055 | -from provisioningserver.tests.test_kernel_opts import make_kernel_parameters |
4056 | from testtools import ExpectedException |
4057 | from testtools.matchers import ( |
4058 | AfterPreprocessing, |
4059 | @@ -99,7 +99,7 @@ |
4060 | |
4061 | |
4062 | class TestBytesReader(MAASTestCase): |
4063 | - """Tests for `provisioningserver.tftp.BytesReader`.""" |
4064 | + """Tests for `maascluster.tftp.BytesReader`.""" |
4065 | |
4066 | def test_interfaces(self): |
4067 | reader = BytesReader(b"") |
4068 | @@ -121,13 +121,13 @@ |
4069 | |
4070 | |
4071 | class TestTFTPBackend(MAASTestCase): |
4072 | - """Tests for `provisioningserver.tftp.TFTPBackend`.""" |
4073 | + """Tests for `maascluster.tftp.TFTPBackend`.""" |
4074 | |
4075 | run_tests_with = MAASTwistedRunTest.make_factory(timeout=5) |
4076 | |
4077 | def setUp(self): |
4078 | super(TestTFTPBackend, self).setUp() |
4079 | - from provisioningserver import boot |
4080 | + from maascluster import boot |
4081 | self.patch(boot, "find_mac_via_arp") |
4082 | self.patch(tftp_module, 'log_request') |
4083 | |
4084 | |
4085 | === modified file 'src/maascluster/pserv_services/tftp.py' |
4086 | --- src/provisioningserver/pserv_services/tftp.py 2015-04-24 20:39:18 +0000 |
4087 | +++ src/maascluster/pserv_services/tftp.py 2015-05-01 07:23:47 +0000 |
4088 | @@ -30,24 +30,24 @@ |
4089 | urlparse, |
4090 | ) |
4091 | |
4092 | -from netaddr import IPAddress |
4093 | -from provisioningserver.boot import ( |
4094 | +from maascluster.boot import ( |
4095 | BootMethodRegistry, |
4096 | get_remote_mac, |
4097 | ) |
4098 | -from provisioningserver.cluster_config import get_cluster_uuid |
4099 | -from provisioningserver.drivers import ArchitectureRegistry |
4100 | -from provisioningserver.events import ( |
4101 | +from maascluster.cluster_config import get_cluster_uuid |
4102 | +from maascluster.drivers import ArchitectureRegistry |
4103 | +from maascluster.events import ( |
4104 | EVENT_TYPES, |
4105 | send_event_node_mac_address, |
4106 | ) |
4107 | -from provisioningserver.kernel_opts import KernelParameters |
4108 | -from provisioningserver.utils import tftp |
4109 | -from provisioningserver.utils.network import get_all_interface_addresses |
4110 | -from provisioningserver.utils.twisted import ( |
4111 | +from maascluster.kernel_opts import KernelParameters |
4112 | +from maascluster.utils import tftp |
4113 | +from maascluster.utils.network import get_all_interface_addresses |
4114 | +from maascluster.utils.twisted import ( |
4115 | deferred, |
4116 | PageFetcher, |
4117 | ) |
4118 | +from netaddr import IPAddress |
4119 | from tftp.backend import FilesystemSynchronousBackend |
4120 | from tftp.errors import ( |
4121 | BackendError, |
4122 | |
4123 | === modified file 'src/maascluster/rpc/__init__.py' |
4124 | --- src/provisioningserver/rpc/__init__.py 2014-09-10 16:20:31 +0000 |
4125 | +++ src/maascluster/rpc/__init__.py 2015-05-01 07:23:47 +0000 |
4126 | @@ -16,8 +16,8 @@ |
4127 | "getRegionClient", |
4128 | ] |
4129 | |
4130 | -import provisioningserver |
4131 | -from provisioningserver.rpc import exceptions |
4132 | +import maascluster |
4133 | +from maascluster.rpc import exceptions |
4134 | |
4135 | |
4136 | def getRegionClient(): |
4137 | @@ -31,7 +31,7 @@ |
4138 | # TODO: retry a couple of times before giving up if the service is |
4139 | # not running or if exceptions.NoConnectionsAvailable gets raised. |
4140 | try: |
4141 | - rpc_service = provisioningserver.services.getServiceNamed('rpc') |
4142 | + rpc_service = maascluster.services.getServiceNamed('rpc') |
4143 | except KeyError: |
4144 | raise exceptions.NoConnectionsAvailable( |
4145 | "Cluster services are unavailable.") |
4146 | |
4147 | === modified file 'src/maascluster/rpc/boot_images.py' |
4148 | --- src/provisioningserver/rpc/boot_images.py 2015-02-24 13:52:12 +0000 |
4149 | +++ src/maascluster/rpc/boot_images.py 2015-05-01 07:23:47 +0000 |
4150 | @@ -21,13 +21,13 @@ |
4151 | import os |
4152 | from urlparse import urlparse |
4153 | |
4154 | -from provisioningserver import concurrency |
4155 | -from provisioningserver.auth import get_maas_user_gpghome |
4156 | -from provisioningserver.boot import tftppath |
4157 | -from provisioningserver.config import BOOT_RESOURCES_STORAGE |
4158 | -from provisioningserver.import_images import boot_resources |
4159 | -from provisioningserver.utils.env import environment_variables |
4160 | -from provisioningserver.utils.twisted import synchronous |
4161 | +from maascluster import concurrency |
4162 | +from maascluster.auth import get_maas_user_gpghome |
4163 | +from maascluster.boot import tftppath |
4164 | +from maascluster.config import BOOT_RESOURCES_STORAGE |
4165 | +from maascluster.import_images import boot_resources |
4166 | +from maascluster.utils.env import environment_variables |
4167 | +from maascluster.utils.twisted import synchronous |
4168 | from twisted.internet.threads import deferToThread |
4169 | |
4170 | |
4171 | |
4172 | === modified file 'src/maascluster/rpc/cluster.py' |
4173 | --- src/provisioningserver/rpc/cluster.py 2015-03-26 15:39:45 +0000 |
4174 | +++ src/maascluster/rpc/cluster.py 2015-05-01 07:23:47 +0000 |
4175 | @@ -33,17 +33,17 @@ |
4176 | "ValidateLicenseKey", |
4177 | ] |
4178 | |
4179 | -from provisioningserver.power.poweraction import ( |
4180 | +from maascluster.power.poweraction import ( |
4181 | PowerActionFail, |
4182 | UnknownPowerType, |
4183 | ) |
4184 | -from provisioningserver.rpc import exceptions |
4185 | -from provisioningserver.rpc.arguments import ( |
4186 | +from maascluster.rpc import exceptions |
4187 | +from maascluster.rpc.arguments import ( |
4188 | Bytes, |
4189 | ParsedURL, |
4190 | StructureAsJSON, |
4191 | ) |
4192 | -from provisioningserver.rpc.common import ( |
4193 | +from maascluster.rpc.common import ( |
4194 | Authenticate, |
4195 | Identify, |
4196 | ) |
4197 | |
4198 | === modified file 'src/maascluster/rpc/clusterservice.py' |
4199 | --- src/provisioningserver/rpc/clusterservice.py 2015-04-22 16:51:55 +0000 |
4200 | +++ src/maascluster/rpc/clusterservice.py 2015-05-01 07:23:47 +0000 |
4201 | @@ -25,70 +25,64 @@ |
4202 | |
4203 | from apiclient.creds import convert_string_to_tuple |
4204 | from apiclient.utils import ascii_url |
4205 | -from provisioningserver import concurrency |
4206 | -from provisioningserver.cluster_config import ( |
4207 | +from maascluster import concurrency |
4208 | +from maascluster.cluster_config import ( |
4209 | get_cluster_uuid, |
4210 | get_maas_url, |
4211 | ) |
4212 | -from provisioningserver.drivers import ( |
4213 | +from maascluster.drivers import ( |
4214 | ArchitectureRegistry, |
4215 | PowerTypeRegistry, |
4216 | ) |
4217 | -from provisioningserver.drivers.hardware.esxi import probe_esxi_and_enlist |
4218 | -from provisioningserver.drivers.hardware.mscm import probe_and_enlist_mscm |
4219 | -from provisioningserver.drivers.hardware.msftocs import ( |
4220 | - probe_and_enlist_msftocs, |
4221 | -) |
4222 | -from provisioningserver.drivers.hardware.seamicro import ( |
4223 | - probe_seamicro15k_and_enlist, |
4224 | -) |
4225 | -from provisioningserver.drivers.hardware.ucsm import probe_and_enlist_ucsm |
4226 | -from provisioningserver.drivers.hardware.virsh import probe_virsh_and_enlist |
4227 | -from provisioningserver.drivers.hardware.vsphere import ( |
4228 | - probe_vsphere_and_enlist, |
4229 | -) |
4230 | -from provisioningserver.logger.log import get_maas_logger |
4231 | -from provisioningserver.network import discover_networks |
4232 | -from provisioningserver.rpc import ( |
4233 | +from maascluster.drivers.hardware.esxi import probe_esxi_and_enlist |
4234 | +from maascluster.drivers.hardware.mscm import probe_and_enlist_mscm |
4235 | +from maascluster.drivers.hardware.msftocs import probe_and_enlist_msftocs |
4236 | +from maascluster.drivers.hardware.seamicro import probe_seamicro15k_and_enlist |
4237 | +from maascluster.drivers.hardware.ucsm import probe_and_enlist_ucsm |
4238 | +from maascluster.drivers.hardware.virsh import probe_virsh_and_enlist |
4239 | +from maascluster.drivers.hardware.vsphere import probe_vsphere_and_enlist |
4240 | +from maascluster.logger.log import get_maas_logger |
4241 | +from maascluster.network import discover_networks |
4242 | +from maascluster.rpc import ( |
4243 | cluster, |
4244 | common, |
4245 | dhcp, |
4246 | exceptions, |
4247 | region, |
4248 | ) |
4249 | -from provisioningserver.rpc.boot_images import ( |
4250 | +from maascluster.rpc.boot_images import ( |
4251 | import_boot_images, |
4252 | is_import_boot_images_running, |
4253 | list_boot_images, |
4254 | ) |
4255 | -from provisioningserver.rpc.common import RPCProtocol |
4256 | -from provisioningserver.rpc.dhcp import ( |
4257 | +from maascluster.rpc.common import RPCProtocol |
4258 | +from maascluster.rpc.dhcp import ( |
4259 | create_host_maps, |
4260 | remove_host_maps, |
4261 | ) |
4262 | -from provisioningserver.rpc.interfaces import IConnection |
4263 | -from provisioningserver.rpc.monitors import ( |
4264 | +from maascluster.rpc.interfaces import IConnection |
4265 | +from maascluster.rpc.monitors import ( |
4266 | cancel_monitor, |
4267 | start_monitors, |
4268 | ) |
4269 | -from provisioningserver.rpc.osystems import ( |
4270 | +from maascluster.rpc.osystems import ( |
4271 | compose_curtin_network_preseed, |
4272 | gen_operating_systems, |
4273 | get_os_release_title, |
4274 | get_preseed_data, |
4275 | validate_license_key, |
4276 | ) |
4277 | -from provisioningserver.rpc.power import ( |
4278 | +from maascluster.rpc.power import ( |
4279 | get_power_state, |
4280 | maybe_change_power_state, |
4281 | ) |
4282 | -from provisioningserver.rpc.tags import evaluate_tag |
4283 | -from provisioningserver.security import ( |
4284 | +from maascluster.rpc.tags import evaluate_tag |
4285 | +from maascluster.security import ( |
4286 | calculate_digest, |
4287 | get_shared_secret_from_filesystem, |
4288 | ) |
4289 | -from provisioningserver.utils.network import find_ip_via_arp |
4290 | -from provisioningserver.utils.twisted import DeferredValue |
4291 | +from maascluster.utils.network import find_ip_via_arp |
4292 | +from maascluster.utils.twisted import DeferredValue |
4293 | from twisted.application.internet import TimerService |
4294 | from twisted.internet.defer import ( |
4295 | inlineCallbacks, |
4296 | @@ -135,7 +129,7 @@ |
4297 | """identify() |
4298 | |
4299 | Implementation of |
4300 | - :py:class:`~provisioningserver.rpc.cluster.Identify`. |
4301 | + :py:class:`~maascluster.rpc.cluster.Identify`. |
4302 | """ |
4303 | return {b"ident": get_cluster_uuid().decode("ascii")} |
4304 | |
4305 | @@ -151,7 +145,7 @@ |
4306 | """list_boot_images() |
4307 | |
4308 | Implementation of |
4309 | - :py:class:`~provisioningserver.rpc.cluster.ListBootImages`. |
4310 | + :py:class:`~maascluster.rpc.cluster.ListBootImages`. |
4311 | """ |
4312 | return {"images": list_boot_images()} |
4313 | |
4314 | @@ -160,7 +154,7 @@ |
4315 | """import_boot_images() |
4316 | |
4317 | Implementation of |
4318 | - :py:class:`~provisioningserver.rpc.cluster.ImportBootImages`. |
4319 | + :py:class:`~maascluster.rpc.cluster.ImportBootImages`. |
4320 | """ |
4321 | get_proxy_url = lambda url: None if url is None else url.geturl() |
4322 | import_boot_images( |
4323 | @@ -173,7 +167,7 @@ |
4324 | """is_import_boot_images_running() |
4325 | |
4326 | Implementation of |
4327 | - :py:class:`~provisioningserver.rpc.cluster.IsImportBootImagesRunning`. |
4328 | + :py:class:`~maascluster.rpc.cluster.IsImportBootImagesRunning`. |
4329 | """ |
4330 | return {"running": is_import_boot_images_running()} |
4331 | |
4332 | @@ -182,7 +176,7 @@ |
4333 | """describe_power_types() |
4334 | |
4335 | Implementation of |
4336 | - :py:class:`~provisioningserver.rpc.cluster.DescribePowerTypes`. |
4337 | + :py:class:`~maascluster.rpc.cluster.DescribePowerTypes`. |
4338 | """ |
4339 | return { |
4340 | 'power_types': [item for name, item in PowerTypeRegistry], |
4341 | @@ -202,7 +196,7 @@ |
4342 | """list_operating_systems() |
4343 | |
4344 | Implementation of |
4345 | - :py:class:`~provisioningserver.rpc.cluster.ListOperatingSystems`. |
4346 | + :py:class:`~maascluster.rpc.cluster.ListOperatingSystems`. |
4347 | """ |
4348 | return {"osystems": gen_operating_systems()} |
4349 | |
4350 | @@ -211,7 +205,7 @@ |
4351 | """get_os_release_title() |
4352 | |
4353 | Implementation of |
4354 | - :py:class:`~provisioningserver.rpc.cluster.GetOSReleaseTitle`. |
4355 | + :py:class:`~maascluster.rpc.cluster.GetOSReleaseTitle`. |
4356 | """ |
4357 | return {"title": get_os_release_title(osystem, release)} |
4358 | |
4359 | @@ -220,7 +214,7 @@ |
4360 | """validate_license_key() |
4361 | |
4362 | Implementation of |
4363 | - :py:class:`~provisioningserver.rpc.cluster.ValidateLicenseKey`. |
4364 | + :py:class:`~maascluster.rpc.cluster.ValidateLicenseKey`. |
4365 | """ |
4366 | return {"is_valid": validate_license_key(osystem, release, key)} |
4367 | |
4368 | @@ -231,7 +225,7 @@ |
4369 | """get_preseed_data() |
4370 | |
4371 | Implementation of |
4372 | - :py:class:`~provisioningserver.rpc.cluster.GetPreseedData`. |
4373 | + :py:class:`~maascluster.rpc.cluster.GetPreseedData`. |
4374 | """ |
4375 | return { |
4376 | "data": get_preseed_data( |
4377 | @@ -244,7 +238,7 @@ |
4378 | """compose_curtin_network_preseed() |
4379 | |
4380 | Implementation of |
4381 | - :py:class:`~provisioningserver.rpc.cluster.ComposeCurtinNetworkPreseed` |
4382 | + :py:class:`~maascluster.rpc.cluster.ComposeCurtinNetworkPreseed` |
4383 | """ |
4384 | interfaces = config.get('interfaces', []) |
4385 | interfaces = [tuple(interface) for interface in interfaces] |
4386 | @@ -332,7 +326,7 @@ |
4387 | Implementation of :py:class:`~twisted.protocols.amp.StartTLS`. |
4388 | """ |
4389 | try: |
4390 | - from provisioningserver.rpc.testing import tls |
4391 | + from maascluster.rpc.testing import tls |
4392 | except ImportError: |
4393 | # This is not a development/test environment. |
4394 | # XXX: Return production TLS parameters. |
4395 | @@ -345,7 +339,7 @@ |
4396 | """evaluate_tag() |
4397 | |
4398 | Implementation of |
4399 | - :py:class:`~provisioningserver.rpc.cluster.EvaluateTag`. |
4400 | + :py:class:`~maascluster.rpc.cluster.EvaluateTag`. |
4401 | """ |
4402 | # It's got to run in a thread because it does blocking IO. |
4403 | d = deferToThread( |
4404 | @@ -360,7 +354,7 @@ |
4405 | def add_virsh(self, user, poweraddr, password, prefix_filter, accept_all): |
4406 | """add_virsh() |
4407 | |
4408 | - Implementation of :py:class:`~provisioningserver.rpc.cluster.AddVirsh`. |
4409 | + Implementation of :py:class:`~maascluster.rpc.cluster.AddVirsh`. |
4410 | """ |
4411 | d = deferToThread( |
4412 | probe_virsh_and_enlist, |
4413 | @@ -373,7 +367,7 @@ |
4414 | password, prefix_filter, accept_all): |
4415 | """add_esxi() |
4416 | |
4417 | - Implementation of :py:class:`~provisioningserver.rpc.cluster.AddESXi`. |
4418 | + Implementation of :py:class:`~maascluster.rpc.cluster.AddESXi`. |
4419 | """ |
4420 | d = deferToThread( |
4421 | probe_esxi_and_enlist, |
4422 | @@ -387,7 +381,7 @@ |
4423 | """add_virsh() |
4424 | |
4425 | Implementation of |
4426 | - :py:class:`~provisioningserver.rpc.cluster.AddSeaMicro15k`. |
4427 | + :py:class:`~maascluster.rpc.cluster.AddSeaMicro15k`. |
4428 | """ |
4429 | ip = find_ip_via_arp(mac) |
4430 | if ip is not None: |
4431 | @@ -409,7 +403,7 @@ |
4432 | """add_vsphere() |
4433 | |
4434 | Implementation of |
4435 | - :py:class:`~provisioningserver.rpc.cluster.AddVsphere`. |
4436 | + :py:class:`~maascluster.rpc.cluster.AddVsphere`. |
4437 | """ |
4438 | d = deferToThread( |
4439 | probe_vsphere_and_enlist, |
4440 | @@ -426,7 +420,7 @@ |
4441 | """enlist_nodes_from_mscm() |
4442 | |
4443 | Implemention of |
4444 | - :py:class:`~provisioningserver.rpc.cluster.EnlistNodesFromMSCM`. |
4445 | + :py:class:`~maascluster.rpc.cluster.EnlistNodesFromMSCM`. |
4446 | """ |
4447 | d = deferToThread( |
4448 | probe_and_enlist_mscm, |
4449 | @@ -440,7 +434,7 @@ |
4450 | """enlist_nodes_from_ucsm() |
4451 | |
4452 | Implemention of |
4453 | - :py:class:`~provisioningserver.rpc.cluster.EnlistNodesFromUCSM`. |
4454 | + :py:class:`~maascluster.rpc.cluster.EnlistNodesFromUCSM`. |
4455 | """ |
4456 | d = deferToThread( |
4457 | probe_and_enlist_ucsm, |
4458 | @@ -455,7 +449,7 @@ |
4459 | |
4460 | Implemention of |
4461 | :py:class: |
4462 | - `~provisioningserver.rpc.cluster.EnlistNodesFromMicrosoftOCS`. |
4463 | + `~maascluster.rpc.cluster.EnlistNodesFromMicrosoftOCS`. |
4464 | """ |
4465 | d = deferToThread( |
4466 | probe_and_enlist_msftocs, |
4467 | |
4468 | === modified file 'src/maascluster/rpc/common.py' |
4469 | --- src/provisioningserver/rpc/common.py 2014-10-03 12:52:35 +0000 |
4470 | +++ src/maascluster/rpc/common.py 2015-05-01 07:23:47 +0000 |
4471 | @@ -19,8 +19,8 @@ |
4472 | "RPCProtocol", |
4473 | ] |
4474 | |
4475 | -from provisioningserver.rpc.interfaces import IConnection |
4476 | -from provisioningserver.utils.twisted import asynchronous |
4477 | +from maascluster.rpc.interfaces import IConnection |
4478 | +from maascluster.utils.twisted import asynchronous |
4479 | from twisted.internet.defer import Deferred |
4480 | from twisted.protocols import amp |
4481 | |
4482 | |
4483 | === modified file 'src/maascluster/rpc/dhcp.py' |
4484 | --- src/provisioningserver/rpc/dhcp.py 2015-03-25 15:33:23 +0000 |
4485 | +++ src/maascluster/rpc/dhcp.py 2015-05-01 07:23:47 +0000 |
4486 | @@ -26,19 +26,19 @@ |
4487 | abstractproperty, |
4488 | ) |
4489 | |
4490 | -from provisioningserver.dhcp import control |
4491 | -from provisioningserver.dhcp.config import get_config |
4492 | -from provisioningserver.dhcp.omshell import Omshell |
4493 | -from provisioningserver.logger import get_maas_logger |
4494 | -from provisioningserver.path import get_path |
4495 | -from provisioningserver.rpc.exceptions import ( |
4496 | +from maascluster.dhcp import control |
4497 | +from maascluster.dhcp.config import get_config |
4498 | +from maascluster.dhcp.omshell import Omshell |
4499 | +from maascluster.logger import get_maas_logger |
4500 | +from maascluster.path import get_path |
4501 | +from maascluster.rpc.exceptions import ( |
4502 | CannotConfigureDHCP, |
4503 | CannotCreateHostMap, |
4504 | CannotRemoveHostMap, |
4505 | ) |
4506 | -from provisioningserver.utils.fs import sudo_write_file |
4507 | -from provisioningserver.utils.shell import ExternalProcessError |
4508 | -from provisioningserver.utils.twisted import synchronous |
4509 | +from maascluster.utils.fs import sudo_write_file |
4510 | +from maascluster.utils.shell import ExternalProcessError |
4511 | +from maascluster.utils.twisted import synchronous |
4512 | |
4513 | |
4514 | maaslog = get_maas_logger("dhcp") |
4515 | |
4516 | === modified file 'src/maascluster/rpc/monitors.py' |
4517 | --- src/provisioningserver/rpc/monitors.py 2014-10-16 11:12:48 +0000 |
4518 | +++ src/maascluster/rpc/monitors.py 2015-05-01 07:23:47 +0000 |
4519 | @@ -19,10 +19,10 @@ |
4520 | |
4521 | from datetime import datetime |
4522 | |
4523 | -from provisioningserver.logger import get_maas_logger |
4524 | -from provisioningserver.rpc import getRegionClient |
4525 | -from provisioningserver.rpc.exceptions import NoConnectionsAvailable |
4526 | -from provisioningserver.rpc.region import MonitorExpired |
4527 | +from maascluster.logger import get_maas_logger |
4528 | +from maascluster.rpc import getRegionClient |
4529 | +from maascluster.rpc.exceptions import NoConnectionsAvailable |
4530 | +from maascluster.rpc.region import MonitorExpired |
4531 | from twisted.internet import reactor |
4532 | from twisted.protocols import amp |
4533 | |
4534 | |
4535 | === modified file 'src/maascluster/rpc/osystems.py' |
4536 | --- src/provisioningserver/rpc/osystems.py 2015-03-25 15:33:23 +0000 |
4537 | +++ src/maascluster/rpc/osystems.py 2015-05-01 07:23:47 +0000 |
4538 | @@ -17,12 +17,12 @@ |
4539 | "validate_license_key", |
4540 | ] |
4541 | |
4542 | -from provisioningserver.drivers.osystem import ( |
4543 | +from maascluster.drivers.osystem import ( |
4544 | Node, |
4545 | OperatingSystemRegistry, |
4546 | Token, |
4547 | ) |
4548 | -from provisioningserver.rpc import exceptions |
4549 | +from maascluster.rpc import exceptions |
4550 | |
4551 | |
4552 | def gen_operating_system_releases(osystem): |
4553 | |
4554 | === modified file 'src/maascluster/rpc/power.py' |
4555 | --- src/provisioningserver/rpc/power.py 2015-04-22 09:18:47 +0000 |
4556 | +++ src/maascluster/rpc/power.py 2015-05-01 07:23:47 +0000 |
4557 | @@ -20,25 +20,25 @@ |
4558 | from datetime import timedelta |
4559 | from functools import partial |
4560 | |
4561 | -from provisioningserver.events import ( |
4562 | +from maascluster.events import ( |
4563 | EVENT_TYPES, |
4564 | send_event_node, |
4565 | ) |
4566 | -from provisioningserver.logger.log import get_maas_logger |
4567 | -from provisioningserver.power.poweraction import ( |
4568 | +from maascluster.logger.log import get_maas_logger |
4569 | +from maascluster.power.poweraction import ( |
4570 | PowerAction, |
4571 | PowerActionFail, |
4572 | ) |
4573 | -from provisioningserver.rpc import getRegionClient |
4574 | -from provisioningserver.rpc.exceptions import ( |
4575 | +from maascluster.rpc import getRegionClient |
4576 | +from maascluster.rpc.exceptions import ( |
4577 | NoSuchNode, |
4578 | PowerActionAlreadyInProgress, |
4579 | ) |
4580 | -from provisioningserver.rpc.region import ( |
4581 | +from maascluster.rpc.region import ( |
4582 | MarkNodeFailed, |
4583 | UpdateNodePowerState, |
4584 | ) |
4585 | -from provisioningserver.utils.twisted import ( |
4586 | +from maascluster.utils.twisted import ( |
4587 | asynchronous, |
4588 | callOut, |
4589 | deferred, |
4590 | |
4591 | === modified file 'src/maascluster/rpc/region.py' |
4592 | --- src/provisioningserver/rpc/region.py 2015-03-25 15:33:23 +0000 |
4593 | +++ src/maascluster/rpc/region.py 2015-05-01 07:23:47 +0000 |
4594 | @@ -41,18 +41,18 @@ |
4595 | "UpdateNodePowerState", |
4596 | ] |
4597 | |
4598 | -from provisioningserver.rpc.arguments import ( |
4599 | +from maascluster.rpc.arguments import ( |
4600 | Bytes, |
4601 | Choice, |
4602 | CompressedAmpList, |
4603 | ParsedURL, |
4604 | StructureAsJSON, |
4605 | ) |
4606 | -from provisioningserver.rpc.common import ( |
4607 | +from maascluster.rpc.common import ( |
4608 | Authenticate, |
4609 | Identify, |
4610 | ) |
4611 | -from provisioningserver.rpc.exceptions import ( |
4612 | +from maascluster.rpc.exceptions import ( |
4613 | CannotRegisterCluster, |
4614 | CommissionNodeFailed, |
4615 | NodeAlreadyExists, |
4616 | |
4617 | === modified file 'src/maascluster/rpc/service.py' |
4618 | --- src/provisioningserver/rpc/service.py 2015-03-25 15:33:23 +0000 |
4619 | +++ src/maascluster/rpc/service.py 2015-05-01 07:23:47 +0000 |
4620 | @@ -29,7 +29,7 @@ |
4621 | STDOUT, |
4622 | ) |
4623 | |
4624 | -from provisioningserver.utils.twisted import ( |
4625 | +from maascluster.utils.twisted import ( |
4626 | asynchronous, |
4627 | synchronous, |
4628 | ) |
4629 | |
4630 | === modified file 'src/maascluster/rpc/tags.py' |
4631 | --- src/provisioningserver/rpc/tags.py 2015-03-25 15:33:23 +0000 |
4632 | +++ src/maascluster/rpc/tags.py 2015-05-01 07:23:47 +0000 |
4633 | @@ -21,12 +21,12 @@ |
4634 | MAASDispatcher, |
4635 | MAASOAuth, |
4636 | ) |
4637 | -from provisioningserver.cluster_config import ( |
4638 | +from maascluster.cluster_config import ( |
4639 | get_cluster_uuid, |
4640 | get_maas_url, |
4641 | ) |
4642 | -from provisioningserver.tags import process_node_tags |
4643 | -from provisioningserver.utils.twisted import synchronous |
4644 | +from maascluster.tags import process_node_tags |
4645 | +from maascluster.utils.twisted import synchronous |
4646 | |
4647 | |
4648 | @synchronous |
4649 | |
4650 | === modified file 'src/maascluster/rpc/testing/__init__.py' |
4651 | --- src/provisioningserver/rpc/testing/__init__.py 2015-03-25 15:33:23 +0000 |
4652 | +++ src/maascluster/rpc/testing/__init__.py 2015-05-01 07:23:47 +0000 |
4653 | @@ -38,29 +38,29 @@ |
4654 | EnvironmentVariable, |
4655 | Fixture, |
4656 | ) |
4657 | -from maastesting.factory import factory |
4658 | -from maastesting.fixtures import TempDirectory |
4659 | -from mock import ( |
4660 | - Mock, |
4661 | - sentinel, |
4662 | -) |
4663 | -import provisioningserver |
4664 | -from provisioningserver.rpc import region |
4665 | -from provisioningserver.rpc.clusterservice import ( |
4666 | +import maascluster |
4667 | +from maascluster.rpc import region |
4668 | +from maascluster.rpc.clusterservice import ( |
4669 | Cluster, |
4670 | ClusterClient, |
4671 | ClusterClientService, |
4672 | ) |
4673 | -from provisioningserver.rpc.common import RPCProtocol |
4674 | -from provisioningserver.rpc.testing.tls import get_tls_parameters_for_region |
4675 | -from provisioningserver.security import ( |
4676 | +from maascluster.rpc.common import RPCProtocol |
4677 | +from maascluster.rpc.testing.tls import get_tls_parameters_for_region |
4678 | +from maascluster.security import ( |
4679 | get_shared_secret_from_filesystem, |
4680 | set_shared_secret_on_filesystem, |
4681 | ) |
4682 | -from provisioningserver.utils.twisted import ( |
4683 | +from maascluster.utils.twisted import ( |
4684 | asynchronous, |
4685 | callOut, |
4686 | ) |
4687 | +from maastesting.factory import factory |
4688 | +from maastesting.fixtures import TempDirectory |
4689 | +from mock import ( |
4690 | + Mock, |
4691 | + sentinel, |
4692 | +) |
4693 | from testtools.deferredruntest import extract_result |
4694 | from testtools.matchers import ( |
4695 | AllMatch, |
4696 | @@ -176,11 +176,11 @@ |
4697 | # into it without moving it aside? For now, keep it simple and avoid |
4698 | # these questions by requiring that services are stopped and that no |
4699 | # RPC service is globally registered. |
4700 | - if provisioningserver.services.running: |
4701 | + if maascluster.services.running: |
4702 | raise AssertionError( |
4703 | "Please ensure that cluster services are *not* running " |
4704 | "before using this fixture.") |
4705 | - if "rpc" in provisioningserver.services.namedServices: |
4706 | + if "rpc" in maascluster.services.namedServices: |
4707 | raise AssertionError( |
4708 | "Please ensure that no RPC service is registered globally " |
4709 | "before using this fixture.") |
4710 | @@ -191,7 +191,7 @@ |
4711 | self.checkServicesClean() |
4712 | # Patch it into the global services object. |
4713 | self.rpc_service.setName("rpc") |
4714 | - self.rpc_service.setServiceParent(provisioningserver.services) |
4715 | + self.rpc_service.setServiceParent(maascluster.services) |
4716 | # Pretend event-loops only exist for those connections that already |
4717 | # exist. The chicken-and-egg will be resolved by injecting a |
4718 | # connection later on. |
4719 | |
4720 | === modified file 'src/maascluster/rpc/testing/doubles.py' |
4721 | --- src/provisioningserver/rpc/testing/doubles.py 2014-09-22 15:16:20 +0000 |
4722 | +++ src/maascluster/rpc/testing/doubles.py 2015-05-01 07:23:47 +0000 |
4723 | @@ -17,8 +17,8 @@ |
4724 | "StubOS", |
4725 | ] |
4726 | |
4727 | -from provisioningserver.drivers.osystem import OperatingSystem |
4728 | -from provisioningserver.rpc.interfaces import IConnection |
4729 | +from maascluster.drivers.osystem import OperatingSystem |
4730 | +from maascluster.rpc.interfaces import IConnection |
4731 | from zope.interface import implementer |
4732 | |
4733 | |
4734 | |
4735 | === modified file 'src/maascluster/rpc/tests/test_arguments.py' |
4736 | --- src/provisioningserver/rpc/tests/test_arguments.py 2015-03-25 15:33:23 +0000 |
4737 | +++ src/maascluster/rpc/tests/test_arguments.py 2015-05-01 07:23:47 +0000 |
4738 | @@ -17,9 +17,9 @@ |
4739 | import random |
4740 | import zlib |
4741 | |
4742 | +from maascluster.rpc import arguments |
4743 | from maastesting.factory import factory |
4744 | from maastesting.testcase import MAASTestCase |
4745 | -from provisioningserver.rpc import arguments |
4746 | from testtools import ExpectedException |
4747 | from testtools.matchers import ( |
4748 | Equals, |
4749 | |
4750 | === modified file 'src/maascluster/rpc/tests/test_boot_images.py' |
4751 | --- src/provisioningserver/rpc/tests/test_boot_images.py 2015-03-25 15:33:23 +0000 |
4752 | +++ src/maascluster/rpc/tests/test_boot_images.py 2015-05-01 07:23:47 +0000 |
4753 | @@ -1,7 +1,7 @@ |
4754 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
4755 | # GNU Affero General Public License version 3 (see the file LICENSE). |
4756 | |
4757 | -"""Tests for provisioningserver.rpc.boot_images""" |
4758 | +"""Tests for maascluster.rpc.boot_images""" |
4759 | |
4760 | from __future__ import ( |
4761 | absolute_import, |
4762 | @@ -17,6 +17,22 @@ |
4763 | import os |
4764 | from random import randint |
4765 | |
4766 | +from maascluster import concurrency |
4767 | +from maascluster.boot import tftppath |
4768 | +from maascluster.config import BOOT_RESOURCES_STORAGE |
4769 | +from maascluster.import_images import boot_resources |
4770 | +from maascluster.rpc import boot_images |
4771 | +from maascluster.rpc.boot_images import ( |
4772 | + _run_import, |
4773 | + get_hosts_from_sources, |
4774 | + import_boot_images, |
4775 | + is_import_boot_images_running, |
4776 | + list_boot_images, |
4777 | + reload_boot_images, |
4778 | +) |
4779 | +from maascluster.testing.config import BootSourcesFixture |
4780 | +from maascluster.testing.testcase import PservTestCase |
4781 | +from maascluster.utils.twisted import pause |
4782 | from maastesting.factory import factory |
4783 | from maastesting.matchers import ( |
4784 | MockCalledOnceWith, |
4785 | @@ -27,22 +43,6 @@ |
4786 | ANY, |
4787 | sentinel, |
4788 | ) |
4789 | -from provisioningserver import concurrency |
4790 | -from provisioningserver.boot import tftppath |
4791 | -from provisioningserver.config import BOOT_RESOURCES_STORAGE |
4792 | -from provisioningserver.import_images import boot_resources |
4793 | -from provisioningserver.rpc import boot_images |
4794 | -from provisioningserver.rpc.boot_images import ( |
4795 | - _run_import, |
4796 | - get_hosts_from_sources, |
4797 | - import_boot_images, |
4798 | - is_import_boot_images_running, |
4799 | - list_boot_images, |
4800 | - reload_boot_images, |
4801 | -) |
4802 | -from provisioningserver.testing.config import BootSourcesFixture |
4803 | -from provisioningserver.testing.testcase import PservTestCase |
4804 | -from provisioningserver.utils.twisted import pause |
4805 | from testtools.matchers import Equals |
4806 | from twisted.internet import defer |
4807 | from twisted.internet.task import Clock |
4808 | |
4809 | === modified file 'src/maascluster/rpc/tests/test_clusterservice.py' |
4810 | --- src/provisioningserver/rpc/tests/test_clusterservice.py 2015-04-22 16:51:55 +0000 |
4811 | +++ src/maascluster/rpc/tests/test_clusterservice.py 2015-05-01 07:23:47 +0000 |
4812 | @@ -30,44 +30,25 @@ |
4813 | |
4814 | from apiclient.creds import convert_tuple_to_string |
4815 | from fixtures import EnvironmentVariable |
4816 | -from maastesting.factory import factory |
4817 | -from maastesting.matchers import ( |
4818 | - IsUnfiredDeferred, |
4819 | - MockAnyCall, |
4820 | - MockCalledOnceWith, |
4821 | - MockCalledWith, |
4822 | - MockCallsMatch, |
4823 | - MockNotCalled, |
4824 | -) |
4825 | -from maastesting.testcase import ( |
4826 | - MAASTestCase, |
4827 | - MAASTwistedRunTest, |
4828 | -) |
4829 | -from mock import ( |
4830 | - ANY, |
4831 | - call, |
4832 | - Mock, |
4833 | - sentinel, |
4834 | -) |
4835 | -from provisioningserver import concurrency |
4836 | -from provisioningserver.boot import tftppath |
4837 | -from provisioningserver.boot.tests.test_tftppath import make_osystem |
4838 | -from provisioningserver.cluster_config import ( |
4839 | +from maascluster import concurrency |
4840 | +from maascluster.boot import tftppath |
4841 | +from maascluster.boot.tests.test_tftppath import make_osystem |
4842 | +from maascluster.cluster_config import ( |
4843 | get_cluster_uuid, |
4844 | get_maas_url, |
4845 | ) |
4846 | -from provisioningserver.dhcp.testing.config import make_subnet_config |
4847 | -from provisioningserver.drivers.osystem import ( |
4848 | +from maascluster.dhcp.testing.config import make_subnet_config |
4849 | +from maascluster.drivers.osystem import ( |
4850 | OperatingSystem, |
4851 | OperatingSystemRegistry, |
4852 | ) |
4853 | -from provisioningserver.network import discover_networks |
4854 | -from provisioningserver.power.poweraction import ( |
4855 | +from maascluster.network import discover_networks |
4856 | +from maascluster.power.poweraction import ( |
4857 | PowerActionFail, |
4858 | UnknownPowerType, |
4859 | ) |
4860 | -from provisioningserver.power_schema import JSON_POWER_TYPE_PARAMETERS |
4861 | -from provisioningserver.rpc import ( |
4862 | +from maascluster.power_schema import JSON_POWER_TYPE_PARAMETERS |
4863 | +from maascluster.rpc import ( |
4864 | boot_images, |
4865 | cluster, |
4866 | clusterservice, |
4867 | @@ -80,20 +61,20 @@ |
4868 | region, |
4869 | tags, |
4870 | ) |
4871 | -from provisioningserver.rpc.clusterservice import ( |
4872 | +from maascluster.rpc.clusterservice import ( |
4873 | Cluster, |
4874 | ClusterClient, |
4875 | ClusterClientService, |
4876 | PatchedURI, |
4877 | ) |
4878 | -from provisioningserver.rpc.interfaces import IConnection |
4879 | -from provisioningserver.rpc.monitors import ( |
4880 | +from maascluster.rpc.interfaces import IConnection |
4881 | +from maascluster.rpc.monitors import ( |
4882 | cancel_monitor, |
4883 | running_monitors, |
4884 | ) |
4885 | -from provisioningserver.rpc.osystems import gen_operating_systems |
4886 | -from provisioningserver.rpc.power import QUERY_POWER_TYPES |
4887 | -from provisioningserver.rpc.testing import ( |
4888 | +from maascluster.rpc.osystems import gen_operating_systems |
4889 | +from maascluster.rpc.power import QUERY_POWER_TYPES |
4890 | +from maascluster.rpc.testing import ( |
4891 | always_fail_with, |
4892 | always_succeed_with, |
4893 | are_valid_tls_parameters, |
4894 | @@ -101,11 +82,30 @@ |
4895 | MockLiveClusterToRegionRPCFixture, |
4896 | TwistedLoggerFixture, |
4897 | ) |
4898 | -from provisioningserver.rpc.testing.doubles import ( |
4899 | +from maascluster.rpc.testing.doubles import ( |
4900 | DummyConnection, |
4901 | StubOS, |
4902 | ) |
4903 | -from provisioningserver.security import set_shared_secret_on_filesystem |
4904 | +from maascluster.security import set_shared_secret_on_filesystem |
4905 | +from maastesting.factory import factory |
4906 | +from maastesting.matchers import ( |
4907 | + IsUnfiredDeferred, |
4908 | + MockAnyCall, |
4909 | + MockCalledOnceWith, |
4910 | + MockCalledWith, |
4911 | + MockCallsMatch, |
4912 | + MockNotCalled, |
4913 | +) |
4914 | +from maastesting.testcase import ( |
4915 | + MAASTestCase, |
4916 | + MAASTwistedRunTest, |
4917 | +) |
4918 | +from mock import ( |
4919 | + ANY, |
4920 | + call, |
4921 | + Mock, |
4922 | + sentinel, |
4923 | +) |
4924 | from testtools import ExpectedException |
4925 | from testtools.deferredruntest import extract_result |
4926 | from testtools.matchers import ( |
4927 | |
4928 | === modified file 'src/maascluster/rpc/tests/test_common.py' |
4929 | --- src/provisioningserver/rpc/tests/test_common.py 2015-03-25 15:33:23 +0000 |
4930 | +++ src/maascluster/rpc/tests/test_common.py 2015-05-01 07:23:47 +0000 |
4931 | @@ -16,6 +16,8 @@ |
4932 | |
4933 | import re |
4934 | |
4935 | +from maascluster.rpc import common |
4936 | +from maascluster.rpc.testing.doubles import DummyConnection |
4937 | from maastesting.matchers import ( |
4938 | IsFiredDeferred, |
4939 | IsUnfiredDeferred, |
4940 | @@ -26,8 +28,6 @@ |
4941 | create_autospec, |
4942 | sentinel, |
4943 | ) |
4944 | -from provisioningserver.rpc import common |
4945 | -from provisioningserver.rpc.testing.doubles import DummyConnection |
4946 | from testtools import ExpectedException |
4947 | from testtools.matchers import ( |
4948 | Equals, |
4949 | @@ -69,7 +69,7 @@ |
4950 | conn = DummyConnection() |
4951 | client = common.Client(conn) |
4952 | expected_message = re.escape( |
4953 | - "provisioningserver.rpc.common.Client called with 3 positional " |
4954 | + "maascluster.rpc.common.Client called with 3 positional " |
4955 | "arguments, (1, 2, 3), but positional arguments are not " |
4956 | "supported. Usage: client(command, arg1=value1, ...)") |
4957 | with ExpectedException(TypeError, expected_message): |
4958 | |
4959 | === modified file 'src/maascluster/rpc/tests/test_dhcp.py' |
4960 | --- src/provisioningserver/rpc/tests/test_dhcp.py 2015-03-25 15:33:23 +0000 |
4961 | +++ src/maascluster/rpc/tests/test_dhcp.py 2015-05-01 07:23:47 +0000 |
4962 | @@ -1,7 +1,7 @@ |
4963 | # Copyright 2014 Canonical Ltd. This software is licensed under the |
4964 | # GNU Affero General Public License version 3 (see the file LICENSE). |
4965 | |
4966 | -"""Tests for :py:module:`~provisioningserver.rpc.dhcp`.""" |
4967 | +"""Tests for :py:module:`~maascluster.rpc.dhcp`.""" |
4968 | |
4969 | from __future__ import ( |
4970 | absolute_import, |
4971 | @@ -17,6 +17,16 @@ |
4972 | from random import randint |
4973 | |
4974 | from fixtures import FakeLogger |
4975 | +from maascluster.dhcp import control |
4976 | +from maascluster.dhcp.omshell import Omshell |
4977 | +from maascluster.dhcp.testing.config import make_subnet_config |
4978 | +from maascluster.path import get_path |
4979 | +from maascluster.rpc import ( |
4980 | + dhcp, |
4981 | + exceptions, |
4982 | +) |
4983 | +from maascluster.rpc.exceptions import CannotConfigureDHCP |
4984 | +from maascluster.utils.shell import ExternalProcessError |
4985 | from maastesting.factory import factory |
4986 | from maastesting.matchers import ( |
4987 | MockAnyCall, |
4988 | @@ -31,16 +41,6 @@ |
4989 | call, |
4990 | sentinel, |
4991 | ) |
4992 | -from provisioningserver.dhcp import control |
4993 | -from provisioningserver.dhcp.omshell import Omshell |
4994 | -from provisioningserver.dhcp.testing.config import make_subnet_config |
4995 | -from provisioningserver.path import get_path |
4996 | -from provisioningserver.rpc import ( |
4997 | - dhcp, |
4998 | - exceptions, |
4999 | -) |
5000 | -from provisioningserver.rpc.exceptions import CannotConfigureDHCP |
The diff has been truncated for viewing.
Looks good… but right now is probably the worse possible moment to land something like this…