From be8d40dc49a814660819fcb56e6e4d4953cfae49 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 18 May 2009 16:22:40 -0700 Subject: [PATCH] xen: Remove Nicira branding from vSwitch xsconsole plugin Since the plan is to eventually integrate this code into the Xen distribution, the Nicira tags have been removed. The copyright is still held by Nicira until a better one is found. --- xenserver/README | 2 +- ...sconsole_plugins-base_XSFeatureVSwitch.py} | 36 ++++++++--------- xenserver/vswitch-xen.spec | 40 +++++++++---------- 3 files changed, 39 insertions(+), 39 deletions(-) rename xenserver/{usr_lib_xsconsole_plugins-base_XSFeatureNiciraVSwitch.py => usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py} (90%) diff --git a/xenserver/README b/xenserver/README index 7088e278..be853ac0 100644 --- a/xenserver/README +++ b/xenserver/README @@ -48,7 +48,7 @@ files are: vswitch-aware replacement for Citrix script of the same name. - usr_lib_xsconsole_plugins-base_XSFeatureNiciraVSwitch.py + usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py xsconsole plugin to configure the pool-wide configuration keys used to control vswitch when integrated with Citrix management diff --git a/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureNiciraVSwitch.py b/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py similarity index 90% rename from xenserver/usr_lib_xsconsole_plugins-base_XSFeatureNiciraVSwitch.py rename to xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py index 9db59071..a9a8cc89 100644 --- a/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureNiciraVSwitch.py +++ b/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py @@ -22,7 +22,7 @@ if __name__ == "__main__": from XSConsoleStandard import * -class NiciraService: +class VSwitchService: service = {} def __init__(self, name, processname=None): @@ -62,7 +62,7 @@ class NiciraService: if processname != None: key = key + "-" + processname if name not in cls.service: - cls.service[key] = NiciraService(name, processname) + cls.service[key] = VSwitchService(name, processname) return cls.service[key] class VSwitchConfig: @@ -83,14 +83,14 @@ class VSwitchConfig: return output -class NiciraControllerDialogue(Dialogue): +class VSwitchControllerDialogue(Dialogue): def __init__(self): Dialogue.__init__(self) data=Data.Inst() self.hostsInPool = 0 self.hostsUpdated = 0 - self.controller = data.GetPoolForThisHost().get("other_config", {}).get("niciraController", "") + self.controller = data.GetPoolForThisHost().get("other_config", {}).get("vswitchController", "") choiceDefs = [ ChoiceDef(Lang("Set pool-wide controller"), @@ -104,13 +104,13 @@ class NiciraControllerDialogue(Dialogue): # ChoiceDef(Lang("Restart brcompatd"), # lambda: self.restartService("vswitch-brcompatd")) ] - self.menu = Menu(self, None, Lang("Configure Nicira vSwitch"), choiceDefs) + self.menu = Menu(self, None, Lang("Configure vSwitch"), choiceDefs) self.ChangeState("INITIAL") def BuildPane(self): pane = self.NewPane(DialoguePane(self.parent)) - pane.TitleSet(Lang("Configure Nicira vSwitch")) + pane.TitleSet(Lang("Configure vSwitch")) pane.AddBox() def ChangeState(self, inState): @@ -171,7 +171,7 @@ class NiciraControllerDialogue(Dialogue): return pane.CurrentInput().HandleKey(inKey) def restartService(self, name): - s = NiciraService.Inst(name) + s = VSwitchService.Inst(name) s.restart() Layout.Inst().PopDialogue() @@ -201,7 +201,7 @@ class NiciraControllerDialogue(Dialogue): def SetController(self, ip): self.hostsInPool = 0 self.hostsUpdated = 0 - Task.Sync(lambda s: self._modifyPoolConfig(s, "niciraController", ip)) + Task.Sync(lambda s: self._modifyPoolConfig(s, "vswitchController", ip)) # Should be done asynchronously, maybe with an external script? Task.Sync(lambda s: self._updateActiveServers(s)) @@ -238,21 +238,21 @@ class NiciraControllerDialogue(Dialogue): session.xenapi.host.call_plugin(host, "vswitch-cfg-update", "update", {}) -class XSFeatureNiciraVSwitch: +class XSFeatureVSwitch: @classmethod def StatusUpdateHandler(cls, inPane): data = Data.Inst() - inPane.AddTitleField(Lang("Nicira vSwitch")) + inPane.AddTitleField(Lang("vSwitch")) inPane.NewLine() - versionStr = data.host.other_config({}).get("niciraSwitchVersion", "") + versionStr = data.host.other_config({}).get("vSwitchVersion", "") inPane.AddStatusField(Lang("Version", 20), versionStr) inPane.NewLine() - dbController = data.GetPoolForThisHost().get("other_config", {}).get("niciraController", "") + dbController = data.GetPoolForThisHost().get("other_config", {}).get("vSwitchController", "") if dbController == "": dbController = Lang("") inPane.AddStatusField(Lang("Controller (config)", 20), dbController) @@ -265,9 +265,9 @@ class XSFeatureNiciraVSwitch: inPane.NewLine() inPane.AddStatusField(Lang("vswitchd status", 20), - NiciraService.Inst("vswitch", "vswitchd").status()) + VSwitchService.Inst("vswitch", "vswitchd").status()) inPane.AddStatusField(Lang("brcompatd status", 20), - NiciraService.Inst("vswitch", "brcompatd").status()) + VSwitchService.Inst("vswitch", "brcompatd").status()) inPane.AddKeyHelpField( { Lang("") : Lang("Reconfigure"), @@ -276,20 +276,20 @@ class XSFeatureNiciraVSwitch: @classmethod def ActivateHandler(cls): - DialogueUtils.AuthenticatedOnly(lambda: Layout.Inst().PushDialogue(NiciraControllerDialogue())) + DialogueUtils.AuthenticatedOnly(lambda: Layout.Inst().PushDialogue(VSwitchControllerDialogue())) def Register(self): Importer.RegisterNamedPlugIn( self, - 'NiciraVSwitch', # Key of this plugin for replacement, etc. + 'VSwitch', # Key of this plugin for replacement, etc. { 'menuname' : 'MENU_NETWORK', 'menupriority' : 800, - 'menutext' : Lang('Nicira vSwitch') , + 'menutext' : Lang('vSwitch') , 'statusupdatehandler' : self.StatusUpdateHandler, 'activatehandler' : self.ActivateHandler } ) # Register this plugin when module is imported -XSFeatureNiciraVSwitch().Register() +XSFeatureVSwitch().Register() diff --git a/xenserver/vswitch-xen.spec b/xenserver/vswitch-xen.spec index 5640c85b..7f1c054e 100644 --- a/xenserver/vswitch-xen.spec +++ b/xenserver/vswitch-xen.spec @@ -65,8 +65,8 @@ install -m 755 xenserver/opt_xensource_libexec_interface-reconfigure \ install -m 755 xenserver/etc_xensource_scripts_vif \ $RPM_BUILD_ROOT%{_prefix}/scripts/vif install -m 755 \ - xenserver/usr_lib_xsconsole_plugins-base_XSFeatureNiciraVSwitch.py \ - $RPM_BUILD_ROOT%{_prefix}/scripts/XSFeatureNiciraVSwitch.py + xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \ + $RPM_BUILD_ROOT%{_prefix}/scripts/XSFeatureVSwitch.py install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/kernel_modules find datapath/linux-2.6 -name *.ko -exec install -m 755 \{\} $RPM_BUILD_ROOT%{_prefix}/kernel_modules/ \; @@ -119,7 +119,7 @@ fi source /etc/xensource-inventory xe host-param-set \ - "other-config:niciraSwitchVersion=%{version}" uuid="$INSTALLATION_UUID" + "other-config:vSwitchVersion=%{version}" uuid="$INSTALLATION_UUID" # Ensure vswitchd.conf exists touch /etc/vswitchd.conf @@ -137,15 +137,15 @@ do mv "$f" %{_prefix}/xs-original/ \ || printf "Could not save original XenServer $s script\n" ln -s "%{_prefix}/scripts/$s" "$f" \ - || printf "Could not link to Nicira $s script\n" + || printf "Could not link to vSwitch $s script\n" fi done # Install xsconsole plugin -plugin=$(readlink /usr/lib/xsconsole/plugins-base/XSFeatureNiciraVSwitch.py) -if [ "$plugin" != "/root/vswitch/scripts/XSFeatureNiciraVSwitch.py" ]; then - rm -f /usr/lib/xsconsole/plugins-base/XSFeatureNiciraVSwitch.py - ln -s /root/vswitch/scripts/XSFeatureNiciraVSwitch.py /usr/lib/xsconsole/plugins-base/ || printf "Could not link to Nicira xsconsole plugin.\n" +plugin=$(readlink /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.py) +if [ "$plugin" != "/root/vswitch/scripts/XSFeatureVSwitch.py" ]; then + rm -f /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.py + ln -s /root/vswitch/scripts/XSFeatureVSwitch.py /usr/lib/xsconsole/plugins-base/ || printf "Could not link to vSswitch xsconsole plugin.\n" fi # Modify conf files for compatibility with our interface-reconfigure @@ -164,11 +164,11 @@ done if [ "$1" = "1" ]; then # $1 = 2 for upgrade printf "\nYou MUST reboot the server NOW to complete the change to the\n" - printf "the Nicira vswitch. Attempts to modify networking on the server\n" + printf "the vSwitch. Attempts to modify networking on the server\n" printf "or any hosted VM will fail until after the reboot and could\n" printf "leave the server in an state requiring manual recovery.\n\n" else - printf "\nTo use the new Nicira vswitch, you should reboot the server\n" + printf "\nTo use the new vSwitch, you should reboot the server\n" printf "now. Failure to do so may result in incorrect operation.\n\n" fi @@ -188,10 +188,10 @@ fi %postun if [ "$1" = "0" ]; then # $1 = 1 for upgrade - rm -f /usr/lib/xsconsole/plugins-base/XSFeatureNiciraVSwitch.py \ - /usr/lib/xsconsole/plugins-base/XSFeatureNiciraVSwitch.pyc \ - /usr/lib/xsconsole/plugins-base/XSFeatureNiciraVSwitch.pyo \ - || printf "Could not remove Nicira xsconsole plugin.\n" + rm -f /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.py \ + /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.pyc \ + /usr/lib/xsconsole/plugins-base/XSFeatureVSwitch.pyo \ + || printf "Could not remove vSwitch xsconsole plugin.\n" # Restore original XenServer scripts for f in \ @@ -210,7 +210,7 @@ if [ "$1" = "0" ]; then # $1 = 1 for upgrade done find %{_prefix} -type d -depth -exec rmdir \{\} \; \ - || printf "Could not remove Nicira vswitch install directory.\n" + || printf "Could not remove vSwitch install directory.\n" # Remove all configuration and log files rm -f /etc/vswitchd.conf @@ -220,12 +220,12 @@ if [ "$1" = "0" ]; then # $1 = 1 for upgrade if [ ! -f /etc/xensource-inventory ]; then printf "XenSource inventory not present in /etc/xensource-inventory\n" - printf "Could not remove niciraSwitchVersion from XAPI database.\n" + printf "Could not remove vSwitchVersion from XAPI database.\n" exit 1 else source /etc/xensource-inventory xe host-param-remove \ - param-name=other-config param-key=niciraSwitchVersion \ + param-name=other-config param-key=vSwitchVersion \ uuid="$INSTALLATION_UUID" fi @@ -249,14 +249,14 @@ fi /root/vswitch/kernel_modules/veth_mod.ko /root/vswitch/scripts/interface-reconfigure /root/vswitch/scripts/vif -/root/vswitch/scripts/XSFeatureNiciraVSwitch.py +/root/vswitch/scripts/XSFeatureVSwitch.py # Following two files are generated automatically by rpm. We don't # really need them and they won't be used on the XenServer, but there # isn't an obvious place to get rid of them since they are generated # after the install script runs. Since they are small, we just # include them. -/root/vswitch/scripts/XSFeatureNiciraVSwitch.pyc -/root/vswitch/scripts/XSFeatureNiciraVSwitch.pyo +/root/vswitch/scripts/XSFeatureVSwitch.pyc +/root/vswitch/scripts/XSFeatureVSwitch.pyo /root/vswitch/sbin/brcompatd /root/vswitch/sbin/vswitchd /root/vswitch/bin/ovs-appctl -- 2.30.2