1253548 Fix version in Fuel Menu header

Change-Id: Icbf34d03d8d775da785a42e1548877e1fe49742d
Closes-Bug: # 1253548
This commit is contained in:
Matthew Mosesohn 2013-11-21 17:44:15 +04:00 committed by Gerrit Code Review
parent bbc0718447
commit 13bcc42e3f
1 changed files with 12 additions and 5 deletions

View File

@ -12,10 +12,12 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import logging
import operator
from optparse import OptionParser
import os
from settings import Settings
import subprocess
import sys
import urwid
@ -68,9 +70,6 @@ class Loader(object):
return (self.modlist, self.choices)
version = "3.2"
class FuelSetup(object):
def __init__(self):
@ -83,6 +82,7 @@ class FuelSetup(object):
self.managediface = "eth0"
#Set to true to move all settings to end
self.globalsave = True
self.version = self.getVersion("/etc/nailgun/version.yaml")
self.main()
self.choices = []
@ -159,6 +159,14 @@ class FuelSetup(object):
#Refresh top level listwalker
#self.listwalker[:] = [self.cols]
def getVersion(self, versionfile):
try:
versiondata = Settings().read(versionfile)
return versiondata['release']
except (IOError, KeyError):
log.error("Unable to set Fuel version from %s" % versionfile)
return ""
def main(self):
#Disable kernel print messages. They make our UI ugly
noout = open('/dev/null', 'w')
@ -167,7 +175,7 @@ class FuelSetup(object):
text_header = (u"Fuel %s setup "
u"Use Up/Down/Left/Right to navigate. F8 exits."
% version)
% self.version)
text_footer = (u"Status messages go here.")
#Top and bottom lines of frame
@ -299,7 +307,6 @@ def save_only(iface):
from common import nailyfactersettings
import common.network as network
import netifaces
from settings import Settings
#Naily.facts translation map from astute.yaml format
facter_translate = \
{