Esempio n. 1
0
    def test_integration(self):
        tftproot = self.make_dir()
        self.useFixture(ClusterConfigurationFixture(tftp_root=tftproot))

        action = factory.make_name("action")
        script = MainScript(action)
        script.register(action, provisioningserver.boot.install_grub)
        script.execute((action, ))

        config_filename = os.path.join("grub", "grub.cfg")
        self.assertThat(os.path.join(tftproot, config_filename), FileExists())
Esempio n. 2
0
    'observe-arp': provisioningserver.utils.arp,
    'observe-beacons': provisioningserver.utils.beaconing,
    'observe-mdns': provisioningserver.utils.avahi,
    'observe-dhcp': provisioningserver.utils.dhcp,
    'send-beacons': provisioningserver.utils.send_beacons,
    'scan-network': provisioningserver.utils.scan_network,
}

RACK_ONLY_COMMANDS = {
    'check-for-shared-secret': security.CheckForSharedSecretScript,
    'config': provisioningserver.cluster_config_command,
    'install-shared-secret': security.InstallSharedSecretScript,
    'install-uefi-config': provisioningserver.boot.install_grub,
    'register': provisioningserver.register_command,
    'support-dump': provisioningserver.support_dump,
    'upgrade-cluster': provisioningserver.upgrade_cluster,
}

main = MainScript(__doc__)

commands = COMMON_COMMANDS.copy()

# If 'maas-common' isn't being executed, add rack-specific commands in addition
# to the generic set of commands.
if not sys.argv[0].endswith('/maas-common'):
    commands.update(RACK_ONLY_COMMANDS)

for name, command in sorted(commands.items()):
    main.register(name, command)
main()