2015-08-18 16:29:56 +00:00
|
|
|
# Copyright 2015 Canonical, Ltd.
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
from subiquity.controller import ControllerPolicy
|
|
|
|
from subiquity.models import NetworkModel
|
2015-10-08 20:11:53 +00:00
|
|
|
from subiquity.ui.views import (NetworkView,
|
|
|
|
NetworkSetDefaultRouteView)
|
2015-08-18 16:29:56 +00:00
|
|
|
from subiquity.ui.dummy import DummyView
|
|
|
|
|
2015-09-10 18:25:54 +00:00
|
|
|
from subiquity.curtin import curtin_write_network_actions
|
|
|
|
|
2015-08-18 16:29:56 +00:00
|
|
|
|
|
|
|
class NetworkController(ControllerPolicy):
|
2015-08-31 15:55:46 +00:00
|
|
|
def __init__(self, common):
|
|
|
|
super().__init__(common)
|
2015-09-03 16:48:40 +00:00
|
|
|
self.model = NetworkModel(self.prober, self.opts)
|
2015-08-18 16:29:56 +00:00
|
|
|
|
|
|
|
def network(self):
|
|
|
|
title = "Network connections"
|
|
|
|
excerpt = ("Configure at least the main interface this server will "
|
|
|
|
"use to talk to other machines, and preferably provide "
|
|
|
|
"sufficient access for updates.")
|
|
|
|
footer = ("Additional networking info here")
|
|
|
|
self.ui.set_header(title, excerpt)
|
2015-08-31 15:55:46 +00:00
|
|
|
self.ui.set_footer(footer, 20)
|
2015-08-18 16:29:56 +00:00
|
|
|
self.ui.set_body(NetworkView(self.model, self.signal))
|
|
|
|
|
2015-09-10 18:25:54 +00:00
|
|
|
def network_finish(self, actions):
|
|
|
|
curtin_write_network_actions(actions)
|
|
|
|
self.signal.emit_signal('filesystem:show')
|
|
|
|
|
2015-08-18 16:29:56 +00:00
|
|
|
def set_default_route(self):
|
2015-10-08 20:11:53 +00:00
|
|
|
self.ui.set_body(NetworkSetDefaultRouteView(self.model,
|
|
|
|
self.signal))
|
2015-08-18 16:29:56 +00:00
|
|
|
|
|
|
|
def bond_interfaces(self):
|
|
|
|
self.ui.set_body(DummyView(self.signal))
|
|
|
|
|
|
|
|
def install_network_driver(self):
|
|
|
|
self.ui.set_body(DummyView(self.signal))
|