Author: gs
Date: Thu Jun 16 12:13:47 2011
New Revision: 64394
URL: http://svn.opensuse.org/viewcvs/yast?rev=64394&view=rev
Log:
Bug-fixes for installation workflow (reset network cards, only
show tabs 'interfaces' and 'configuration', reset modified flag),
stop services fcoe or lldpad on 'Abort' (if started here)
Modified:
branches/SuSE-Code-11-SP2-Branch/fcoe-client/VERSION
branches/SuSE-Code-11-SP2-Branch/fcoe-client/package/yast2-fcoe-client.changes
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/inst_fcoe-client.ycp
branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/wizards.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/VERSION?rev=64394&r1=64393&r2=64394&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/VERSION (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/VERSION Thu Jun 16 12:13:47 2011
@@ -1 +1 @@
-2.17.2
+2.17.3
Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/package/yast2-fcoe-client.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/package/yast2-fcoe-client.changes?rev=64394&r1=64393&r2=64394&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/package/yast2-fcoe-client.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/package/yast2-fcoe-client.changes Thu Jun 16 12:13:47 2011
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Thu Jun 16 12:09:57 CEST 2011 - gs@suse.de
+
+- Bug-fixes for installation workflow (reset network cards, only
+ show tabs 'interfaces' and 'configuration', reset modified flag),
+ stop services fcoe or lldpad on 'Abort' (if started here)
+- V 2.17.3
+
+-------------------------------------------------------------------
Tue May 31 12:21:30 CEST 2011 - gs@suse.de
- Create VLAN interface and start FCoE during installation, only
Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp?rev=64394&r1=64393&r2=64394&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp Thu Jun 16 12:13:47 2011
@@ -87,7 +87,7 @@
* @return true if modified
*/
global boolean Modified() {
- y2debug("modified=%1",modified);
+ y2debug( "get modified = %1", modified );
return modified;
}
@@ -95,8 +95,9 @@
* Mark as modified, for Autoyast.
*/
global void SetModified(boolean value) {
- modified = true;
- }
+ y2debug( "set modified to %1", value );
+ modified = value;
+}
global boolean ProposalValid() {
return proposal_valid;
@@ -120,7 +121,6 @@
write_only = value;
}
-
global void SetAbortFunction(boolean() function) {
AbortFunction = function;
}
@@ -155,9 +155,6 @@
*/
-
-// Settings: Define all variables needed for configuration of fcoe-client
-
// Define all the variables necessary to hold
global integer current_card = 0; // currently selected card, means row in list of cards
@@ -165,20 +162,81 @@
global string NOT_CONFIGURED = "not configured";
global string NOT_AVAILABLE = "not available";
-// map containing information about networks cards and VLAN, FCoE and DCB status
-list <map> network_interfaces = [];
+global boolean lldpad_started = false; // service fcoe was started
+global boolean fcoe_started = false; // service lldpad was started
+
+
+// Settings: Define all variables needed for configuration of fcoe-client
// map containing information about values in /etc/fcoe/config
map fcoe_general_config = $[ "DEBUG":"no",
"USE_SYSLOG":"yes" ];
-// list containing information about 'redo' commands
-list <string> redo_list = [];
+// Set value in fcoe_general_config
+global void SetFcoeConfigValue( string param, string value )
+{
+ fcoe_general_config[ param ] = value;
+}
+
+// Returns the map containing general FCoE configuration
+global map GetFcoeConfig()
+{
+ return fcoe_general_config;
+}
+
+// list containing information about commands to revert changes
+list <string> revert_list = [];
+
+// Add a command to the list of revert commands
+global void AddRevertCommand( string command )
+{
+ revert_list = add( revert_list, command );
+ y2milestone( "Adding revert command: %1", command );
+}
+
+// Get the list of revert commands
+global list GetRevertCommands()
+{
+ return revert_list;
+}
+
+// Reset list of revert commands
+global void ResetRevertCommands()
+{
+ revert_list = [];
+}
-// map containing information about start of services
+// map containing information about start of services at boot
map service_start = $[ "fcoe":false,
"lldpad":false ];
+// map containing information about networks cards and VLAN, FCoE and DCB status
+list <map> network_interfaces = [];
+
+// Returns the map containing all detected interfaces including
+global list <map> GetNetworkCards()
+{
+ return network_interfaces;
+}
+
+// Get currently selected network card
+global map GetCurrentNetworkCard()
+{
+ return network_interfaces[current_card]:$[];
+}
+
+// Set network card values for given row
+global void SetNetworkCardsValue( integer row, map card )
+{
+ network_interfaces[row] = card;
+}
+
+// Reset list of detected cards
+global void ResetNetworkCards()
+{
+ network_interfaces = [];
+}
+
//
// Check whether open-fcoe is installed and do installation if user agrees
// (dependencies: 'lldpad', 'libhbalinux2' and 'libHBAAPI2')
@@ -437,6 +495,9 @@
return service_start;
}
+//
+// Check status of services 'fcoe' and 'lldpad' and start them if required
+//
global boolean ServiceStatus()
{
// TODO - check whether loading any modules in Stage::initial() is required
@@ -450,6 +511,7 @@
if ( success )
{
y2milestone( "FCoE started (/etc/init.d/fcoe start)");
+ fcoe_started = true;;
}
else
{
@@ -470,6 +532,7 @@
if ( success )
{
y2milestone( "Lldpad started (/etc/init.d/lldpad start)");
+ lldpad_started = true;
}
else
{
@@ -515,7 +578,7 @@
// FCoE isn't enabled on the switch - we can't do anything here
// TODO - check link map from .probe.network and distinguish between
// no cable attached and interface not up, Steffen: cannot be used, "no"
- // can stand for 'noe cable' or 'not up'
+ // can stand for 'no cable connected' or 'interface not up'
fcoe_vlan_interface = NOT_AVAILABLE;
}
else
@@ -554,30 +617,6 @@
}
//
-// Returns the map containing all detected interfaces including
-// configuration status of VLAN, FCoE and DCB
-//
-global list <map> GetNetworkCards()
-{
- return network_interfaces;
-}
-
-global map GetCurrentNetworkCard()
-{
- return network_interfaces[current_card]:$[];
-}
-
-global void SetNetworkCardsValue( integer row, map card )
-{
- network_interfaces[row] = card;
-}
-
-global void ResetNetworkCards()
-{
- network_interfaces = [];
-}
-
-//
// Read /etc/fcoe/config
//
global boolean ReadFcoeConfig()
@@ -598,38 +637,8 @@
}
//
-// Set value in fcoe_general_config
+// Write /etc/fcoe/config using SCR agent
//
-global void SetFcoeConfigValue( string param, string value )
-{
- fcoe_general_config[ param ] = value;
-}
-
-//
-// Returns the map containing general FCoE configuration
-//
-global map GetFcoeConfig()
-{
- return fcoe_general_config;
-}
-
-//
-// Add a command to the list of redo commands
-//
-global void AddRedoCommand( string command )
-{
- redo_list = add( redo_list, command );
- y2milestone( "Adding redo command: %1", command );
-}
-
-//
-// Get the list of redo commands
-//
-global list GetRedoCommands()
-{
- return redo_list;
-}
-
global boolean WriteFcoeConfig()
{
boolean ret = true;
@@ -648,6 +657,9 @@
return ret;
}
+//
+// Write /etc/fcoe/cfg-ethx files
+//
global boolean WriteCfgFiles()
{
list <map> netcards = GetNetworkCards();
@@ -794,6 +806,7 @@
Progress::Finish();
if(PollAbort()) return false;
+ // modified = false is from CWM template
modified = false;
return true;
@@ -845,7 +858,7 @@
// write settings
if(PollAbort()) return false;
Progress::NextStage();
-
+
boolean success = WriteFcoeConfig();
/* Error message */
if( !success ) Report::Error (_("Cannot write settings to /etc/fcoe/config."));
Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp?rev=64394&r1=64393&r2=64394&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp Thu Jun 16 12:13:47 2011
@@ -45,10 +45,23 @@
/**
* Show a popup on abort if data are modified and
- * check redo list/execute redo commands.
+ * check list of commands to revert changes done to the system.
+ * This function is also called during installation if user aborts
+ * the 'FCoE client configuration', i.e. commands from revert list
+ * are executed and list is reset.
* @return true if users aborts installation
*/
boolean ReallyAbort() {
+ // revert start of 'fcoe' or 'lldpad'
+ if ( FcoeClient::fcoe_started )
+ {
+ Service::Stop( "fcoe" );
+ }
+ if ( FcoeClient::lldpad_started )
+ {
+ Service::Stop( "lldpad" );
+ }
+
if ( !FcoeClient::Modified() )
return true;
@@ -56,20 +69,21 @@
if ( abort )
{
- // check redo list
- list redo_list = FcoeClient::GetRedoCommands();
- if ( redo_list == [] )
+ // check revert list
+ list revert_list = FcoeClient::GetRevertCommands();
+ if ( revert_list == [] )
{
- y2milestone( "Nothing to redo");
+ y2milestone( "Nothing to revert");
}
else
{
- foreach ( string command, (list<string>)redo_list, {
+ foreach ( string command, (list<string>)revert_list, {
y2milestone( "Calling %1", command );
map output = (map)SCR::Execute( .target.bash_output, command );
y2milestone( "Output: %1", output );
} );
+ FcoeClient::ResetRevertCommands(); // important during installation
}
}
return abort;
@@ -106,7 +120,7 @@
**/
void InitServicesDialog (string id) {
y2milestone( "Init services dialog" );
-
+ y2milestone( "Modified: %1", FcoeClient::Modified() );
map status_map = FcoeClient::GetStartStatus();
if ( status_map["fcoe"]:false == true )
@@ -359,9 +373,9 @@
y2milestone( "FCoE VLAN interface %1 created/started", fcoe_vlan_interface );
status_map = FcoeClient::GetFCoEStatus( fcoe_vlan_interface );
- // store command to be able to redo the creation of FCoE VLAN interface in case of abort
+ // store command to be able to revert the creation of FCoE VLAN interface in case of abort
// TODO: is this also OK if only 'fipvlan -s <interface>' is called?
- FcoeClient::AddRedoCommand( sformat("vconfig rem %1", fcoe_vlan_interface ) );
+ FcoeClient::AddRevertCommand( sformat("vconfig rem %1", fcoe_vlan_interface ) );
if ( create_ifcfg )
{
string config = sformat( "BOOTPROTO=\"static\"\nSTARTMODE=\"onboot\"
@@ -369,7 +383,7 @@
ifcfg_file = sformat( "/etc/sysconfig/network/ifcfg-%1", fcoe_vlan_interface );
SCR::Write(.target.string, ifcfg_file, config);
y2milestone( "Writing config: %1 to %2", config, ifcfg_file );
- FcoeClient::AddRedoCommand( sformat( "rm %1", ifcfg_file ) );
+ FcoeClient::AddRevertCommand( sformat( "rm %1", ifcfg_file ) );
}
}
else
Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/inst_fcoe-client.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/inst_fcoe-client.ycp?rev=64394&r1=64393&r2=64394&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/inst_fcoe-client.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/inst_fcoe-client.ycp Thu Jun 16 12:13:47 2011
@@ -85,17 +85,21 @@
ret = MainSequence();
y2milestone("MainSequence ret=%1", ret);
-// add package open-fcoe to pool that is then used by software proposal
-// to propose a selection
-PackagesProposal::AddResolvables( "fcoe", `package, ["open-fcoe"] );
-
// workflow not aborted
if ( ret == `next )
{
+ // add package open-fcoe to the pool that is used by software proposal
+ y2milestone( "Adding package open-fcoe to pool" );
+ PackagesProposal::AddResolvables( "fcoe", `package, ["open-fcoe"] );
// write changes to config files
+ y2milestone( "Writing config files");
FcoeClient::WriteFcoeConfig();
FcoeClient::WriteCfgFiles();
+ // restart fcoemon
+ y2milestone( "Restarting FCoE" );
FcoeClient::RestartServiceFcoe();
+ // reset modified flag
+ FcoeClient::SetModified( false );
}
/* Finish */
Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/wizards.ycp?rev=64394&r1=64393&r2=64394&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/wizards.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/wizards.ycp Thu Jun 16 12:13:47 2011
@@ -74,42 +74,65 @@
"store" : StoreConfigurationDialog,
],
];
- map tabs =
- $[
- "services" : $[
- // Header of tab in tab widget
- "header" : _("&Services"),
- "widget_names" : ["serv"],
- "contents" : ServicesDialogContent(),
- ],
- "interfaces" : $[
- // Header of tab in tab widget
- "header" : _("&Interfaces"),
- "widget_names" : ["inter"],
- "contents" : InterfacesDialogContent(),
- ],
- "configuration" : $[
- // Header of tab in tab widget
- "header" : _("&Configuration"),
- "widget_names" : ["config"],
- "contents" : ConfigurationDialogContent(),
- ],
- ];
-
+ map tabs = $[];
+ list tab_order = [];
string ini_tab = "";
- map status_map = FcoeClient::GetStartStatus();
-
- if ( status_map["fcoe"]:false == true || status_map["lldpad"]:false == true )
+ if ( Stage::initial() )
+ {
+ tabs = $[
+ "interfaces" : $[
+ // Header of tab in tab widget
+ "header" : _("&Interfaces"),
+ "widget_names" : ["inter"],
+ "contents" : InterfacesDialogContent(),
+ ],
+ "configuration" : $[
+ // Header of tab in tab widget
+ "header" : _("&Configuration"),
+ "widget_names" : ["config"],
+ "contents" : ConfigurationDialogContent(),
+ ],
+ ];
ini_tab = "interfaces";
+ tab_order = [ "interfaces", "configuration"];
+ }
else
- ini_tab = "services";
+ {
+ tabs = $[
+ "services" : $[
+ // Header of tab in tab widget
+ "header" : _("&Services"),
+ "widget_names" : ["serv"],
+ "contents" : ServicesDialogContent(),
+ ],
+ "interfaces" : $[
+ // Header of tab in tab widget
+ "header" : _("&Interfaces"),
+ "widget_names" : ["inter"],
+ "contents" : InterfacesDialogContent(),
+ ],
+ "configuration" : $[
+ // Header of tab in tab widget
+ "header" : _("&Configuration"),
+ "widget_names" : ["config"],
+ "contents" : ConfigurationDialogContent(),
+ ],
+ ];
+
+ map status_map = FcoeClient::GetStartStatus();
+ if ( status_map["fcoe"]:false == true || status_map["lldpad"]:false == true )
+ ini_tab = "interfaces";
+ else
+ ini_tab = "services";
+ tab_order = ["services", "interfaces", "configuration"];
+ }
map wd =
$[
"tab" : CWMTab::CreateWidget (
$[
- "tab_order" : ["services", "interfaces", "configuration"],
+ "tab_order" : tab_order,
"tabs" : tabs,
"widget_descr" : widgets,
"initial_tab" : ini_tab,
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org