summaryrefslogtreecommitdiff
path: root/rtsadmin/ui_root.py
diff options
context:
space:
mode:
authorJerome Martin <jxm@risingtidesystems.com>2011-07-18 23:54:37 +0200
committerJerome Martin <jxm@risingtidesystems.com>2011-07-19 00:09:17 +0200
commit0876739948b9300bfd32c88fa0ff661537c7be59 (patch)
treecf88e9b622818b807915fe25002427cc2416f402 /rtsadmin/ui_root.py
parent1b06ee3754d3db376a5fb7fac45d2deabe1ca465 (diff)
downloadtargetcli-0876739948b9300bfd32c88fa0ff661537c7be59.tar.gz
Moved saveconfig to /, added hostname reminder.
* Reminder is useful for remote access. * Moving to root node makes it clear that the whole config is saved, not just the current node or subtree. * Removes command clutter from nodes.
Diffstat (limited to 'rtsadmin/ui_root.py')
-rw-r--r--rtsadmin/ui_root.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/rtsadmin/ui_root.py b/rtsadmin/ui_root.py
index 906a0fe..db3096b 100644
--- a/rtsadmin/ui_root.py
+++ b/rtsadmin/ui_root.py
@@ -17,8 +17,10 @@ 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 os import system
from rtslib import RTSRoot
from ui_node import UINode
+from socket import gethostname
from ui_target import UIFabricModule
from ui_backstore_legacy import UIBackstoresLegacy
from ui_backstore import UIBackstores
@@ -69,6 +71,19 @@ class UIRoot(UINode):
self.shell.log.debug("Loading %s." % fabric_module.name)
UIFabricModule(fabric_module, self)
+ def ui_command_saveconfig(self):
+ '''
+ Saves the whole configuration tree to disk so that it will be restored
+ on next boot. Unless you do that, changes are lost accross reboots.
+ '''
+ self.assert_root()
+ self.shell.con.display("WARNING: Saving %s current configuration to "
+ % gethostname()
+ + "disk will overwrite your boot settings.")
+ self.shell.con.display("The current target configuration will become "
+ + "the default boot config.")
+ system('PYTHONPATH="" python /usr/sbin/tcm_dump --o')
+
def ui_command_version(self):
'''
Displays the rtsadmin and support libraries versions.