Skip to contentSkip to conversation

conga/luci/site/luci/Extensions homebase_adapt ...

Cluster-devel [email protected] 1 participant 1 message Oct 11, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-10-11 21:48:04

Modified files:
luci/site/luci/Extensions: homebase_adapters.py clusterOS.py

Log message:
workaround ricci supplying a blank os; assume rhel5

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/clusterOS.py.diff?cvsroot=cluster&r1=1.1&r2=1.2

luci/site/luci/Extensions/homebase_adapters.py +2 -2
@@ -172,7 +172,7 @@
 
 	if rc.authed():
 		os_str = resolveOSType(rc.os())
-		if os_str == None:
+		if not os_str:
 			os_str = "rhel5"  #Backup plan in case all is almost lost...
 
 		systemName = rc.system_name()
@@ -226,7 +226,7 @@
 		cluster_info = None
 
 	os_str = resolveOSType(rc.os())
-	if os_str == None:
+	if not os_str:
 		os_str = "rhel5"  #Backup plan in case all is almost lost...
 
 	if not cluster_info or not cluster_info[0]:
luci/site/luci/Extensions/clusterOS.py +4 -4
@@ -1,5 +1,5 @@
-def resolveOSType(os):
-	if os.find("Tikanga") != (-1) or os.find("FC6") != (-1):
-		return "rhel5"
+def resolveOSType(os_str):
+	if not os_str or os_str.find('Tikanga') != (-1) or os_str.find('FC6') != (-1):
+		return 'rhel5'
 	else:
-		return "rhel4"
+		return 'rhel4'