Beispiel #1
0
    def destroy(self, n):
        vhost_names = config.get_all("vhost_filename")

        for filename in vhost_names:
            vhost_path, active_path = self._getApachePaths(filename)
            cautious_cmd("rm", [vhost_path, active_path], sudo=True)

        self.destroy_success("Destroyed vhosts.")
Beispiel #2
0
    def destroy(self, n):
        vhost_names = config.get_all("vhost_filename")

        for filename in vhost_names:
            vhost_path, active_path = self._getApachePaths(filename)
            cautious_cmd("rm", [vhost_path, active_path], sudo=True)

        self.destroy_success("Destroyed vhosts.")
Beispiel #3
0
    def action(self, n):
        vhost_filename = make_vhost_name(n.site_type)
        config.add(n.site_type, "vhost_filename", vhost_filename)

        fill_args = dict(n.__dict__, server_name=make_server_name(n.site_type))
        vhost = self.fillTemplate("vhost.tpl", fill_args)

        vhost_path, active_path = self._getApachePaths(vhost_filename)

        cautious_cmd("tee", vhost_path, sudo=True, stdin=vhost)
        cautious_cmd("ln", ['-s', vhost_path, active_path], sudo=True)

        self.success("Created and activated vhost.")
Beispiel #4
0
    def action(self, n):
        vhost_filename = make_vhost_name(n.site_type)
        config.add(n.site_type, "vhost_filename", vhost_filename)

        fill_args = dict(n.__dict__, server_name=make_server_name(n.site_type))
        vhost = self.fillTemplate("vhost.tpl", fill_args)

        vhost_path, active_path = self._getApachePaths(vhost_filename)

        cautious_cmd("tee", vhost_path, sudo=True, stdin=vhost)
        cautious_cmd("ln", ['-s', vhost_path, active_path], sudo=True)

        self.success("Created and activated vhost.")