本文整理汇总了Python中pyanaconda.iutil.ipmi_report函数的典型用法代码示例。如果您正苦于以下问题:Python ipmi_report函数的具体用法?Python ipmi_report怎么用?Python ipmi_report使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ipmi_report函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: on_info_bar_clicked
def on_info_bar_clicked(self, *args):
if self.errors:
label = _("The following errors were encountered when checking your storage "
"configuration. You can modify your storage layout or quit the "
"installer.")
dialog = DetailedErrorDialog(self.data, buttons=[
C_("GUI|Storage|Error Dialog", "_Quit"),
C_("GUI|Storage|Error Dialog", "_Modify Storage Layout")],
label=label)
with self.main_window.enlightbox(dialog.window):
errors = "\n".join(self.errors)
dialog.refresh(errors)
rc = dialog.run()
dialog.window.destroy()
if rc == 0:
# Quit.
sys.exit(0)
iutil.ipmi_report(constants.IPMI_ABORTED)
elif self.warnings:
label = _("The following warnings were encountered when checking your storage "
"configuration. These are not fatal, but you may wish to make "
"changes to your storage layout.")
dialog = DetailedErrorDialog(self.data, buttons=[_("_OK")], label=label)
with self.main_window.enlightbox(dialog.window):
warnings = "\n".join(self.warnings)
dialog.refresh(warnings)
rc = dialog.run()
dialog.window.destroy()
开发者ID:jresch,项目名称:anaconda,代码行数:33,代码来源:storage.py
示例2: connectToView
def connectToView(self):
"""Attempt to connect to self.vncconnecthost"""
maxTries = 10
self.log.info(_("Attempting to connect to vnc client on host %s..."), self.vncconnecthost)
if self.vncconnectport != "":
hostarg = self.vncconnecthost + ":" + self.vncconnectport
else:
hostarg = self.vncconnecthost
vncconfigcommand = [self.root+"/usr/bin/vncconfig", "-display", ":%s" % constants.X_DISPLAY_NUMBER, "-connect", hostarg]
for _i in range(maxTries):
vncconfp = iutil.startProgram(vncconfigcommand, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # vncconfig process
err = vncconfp.communicate()[1].decode("utf-8")
if err == '':
self.log.info(_("Connected!"))
return True
elif err.startswith("connecting") and err.endswith("failed\n"):
self.log.info(_("Will try to connect again in 15 seconds..."))
time.sleep(15)
continue
else:
log.critical(err)
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
self.log.error(P_("Giving up attempting to connect after %d try!\n",
"Giving up attempting to connect after %d tries!\n",
maxTries), maxTries)
return False
开发者ID:fabiand,项目名称:anaconda-1,代码行数:32,代码来源:vnc.py
示例3: input
def input(self, args, key):
"""This dialog is closed by any input.
And causes the program to quit.
"""
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
开发者ID:Jakuje,项目名称:anaconda,代码行数:7,代码来源:tuiobject.py
示例4: input
def input(self, args, key):
"""Override input so that we can launch the VNC password spoke"""
try:
keyid = int(key) - 1
if 0 <= keyid < len(self._choices):
choice = self._choices[keyid]
if choice == _(USETEXT):
self._usevnc = False
else:
self._usevnc = True
newspoke = VNCPassSpoke(self.app, self.data, self.storage,
self.payload, self.instclass)
self.app.switch_screen_modal(newspoke)
self.apply()
self.close()
return INPUT_PROCESSED
except ValueError:
pass
# TRANSLATORS: 'q' to quit
if key.lower() == C_('TUI|Spoke Navigation', 'q'):
d = YesNoDialog(self.app, _(self.app.quit_message))
self.app.switch_screen_modal(d)
if d.answer:
iutil.ipmi_report(IPMI_ABORTED)
if can_touch_runtime_system("Quit and Reboot"):
execWithRedirect("systemctl", ["--no-wall", "reboot"])
else:
exit(1)
else:
return key
开发者ID:thaygiaoth,项目名称:anaconda,代码行数:33,代码来源:askvnc.py
示例5: _on_continue_clicked
def _on_continue_clicked(self, window, user_data=None):
# Don't display the betanag dialog if this is the final release.
if not isFinal:
dlg = self.builder.get_object("betaWarnDialog")
with self.main_window.enlightbox(dlg):
rc = dlg.run()
dlg.destroy()
if rc != 1:
ipmi_report(IPMI_ABORTED)
sys.exit(0)
if (
productName.startswith("Red Hat ")
and is_unsupported_hw()
and not self.data.unsupportedhardware.unsupported_hardware
):
dlg = self.builder.get_object("unsupportedHardwareDialog")
with self.main_window.enlightbox(dlg):
rc = dlg.run()
dlg.destroy()
if rc != 1:
ipmi_report(IPMI_ABORTED)
sys.exit(0)
StandaloneSpoke._on_continue_clicked(self, window, user_data)
开发者ID:KosiehBarter,项目名称:anaconda,代码行数:25,代码来源:welcome.py
示例6: on_info_bar_clicked
def on_info_bar_clicked(self, *args):
if not self._errorMsgs:
return
label = _("The software marked for installation has the following errors. "
"This is likely caused by an error with your installation source. "
"You can quit the installer, change your software source, or change "
"your software selections.")
dialog = DetailedErrorDialog(self.data,
buttons=[C_("GUI|Software Selection|Error Dialog", "_Quit"),
C_("GUI|Software Selection|Error Dialog", "_Modify Software Source"),
C_("GUI|Software Selection|Error Dialog", "Modify _Selections")],
label=label)
with self.main_window.enlightbox(dialog.window):
dialog.refresh(self._errorMsgs)
rc = dialog.run()
dialog.window.destroy()
if rc == 0:
# Quit.
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(0)
elif rc == 1:
# Send the user to the installation source spoke.
self.skipTo = "SourceSpoke"
self.window.emit("button-clicked")
elif rc == 2:
# Close the dialog so the user can change selections.
pass
else:
pass
开发者ID:KosiehBarter,项目名称:anaconda,代码行数:32,代码来源:software.py
示例7: refresh
def refresh(self, args=None):
from pyanaconda.install import doInstall, doConfiguration
from pyanaconda.threads import threadMgr, AnacondaThread
# We print this here because we don't really use the window object
print(_(self.title))
threadMgr.add(AnacondaThread(name=THREAD_INSTALL, target=doInstall,
args=(self.storage, self.payload, self.data,
self.instclass)))
# This will run until we're all done with the install thread.
self._update_progress()
threadMgr.add(AnacondaThread(name=THREAD_CONFIGURATION, target=doConfiguration,
args=(self.storage, self.payload, self.data,
self.instclass)))
# This will run until we're all done with the configuration thread.
self._update_progress()
iutil.ipmi_report(IPMI_FINISHED)
# kickstart install, continue automatically if reboot or shutdown selected
if flags.automatedInstall and self.data.reboot.action in [KS_REBOOT, KS_SHUTDOWN]:
# Just pretend like we got input, and our input doesn't care
# what it gets, it just quits.
self.input(None, None)
return True
开发者ID:NealSCarffery,项目名称:anaconda,代码行数:30,代码来源:progress.py
示例8: _configuration_done
def _configuration_done(self):
# Configuration done, remove ransom notes timer
# and switch to the Reboot page
GLib.source_remove(self._rnotes_id)
self._progressNotebook.set_current_page(1)
iutil.ipmi_report(IPMI_FINISHED)
# kickstart install, continue automatically if reboot or shutdown selected
if flags.automatedInstall and self.data.reboot.action in [KS_REBOOT, KS_SHUTDOWN]:
self.window.emit("continue-clicked")
开发者ID:NealSCarffery,项目名称:anaconda,代码行数:12,代码来源:progress.py
示例9: input
def input(self, args, key):
"""Method called internally to process unhandled input key presses.
Also handles the main quit and close commands.
:param args: optional argument passed from switch_screen calls
:type args: anything
:param key: the string entered by user
:type key: str
:return: True if key was processed, False if it was not recognized
:rtype: True|False
"""
# delegate the handling to active screen first
if self._screens:
try:
key = self._screens[-1][0].input(args, key)
if key is None:
return True
except ExitMainLoop:
raise
except Exception: # pylint: disable=broad-except
send_exception(self.queue_instance, sys.exc_info())
return False
# global refresh command
# TRANSLATORS: 'r' to refresh
if self._screens and (key == C_('TUI|Spoke Navigation', 'r')):
self._do_redraw()
return True
# global close command
# TRANSLATORS: 'c' to continue
if self._screens and (key == C_('TUI|Spoke Navigation', 'c')):
self.close_screen()
return True
# global quit command
# TRANSLATORS: 'q' to quit
elif self._screens and (key == C_('TUI|Spoke Navigation', 'q')):
if self.quit_question:
d = self.quit_question(self, _(self.quit_message))
self.switch_screen_modal(d)
if d.answer:
raise ExitAllMainLoops()
iutil.ipmi_report(constants.IPMI_ABORTED)
return True
return False
开发者ID:jresch,项目名称:anaconda,代码行数:52,代码来源:base.py
示例10: _on_quit_clicked
def _on_quit_clicked(self, win, userData=None):
if not win.get_quit_button():
return
dialog = self._quitDialog(None)
with self.mainWindow.enlightbox(dialog.window):
rc = dialog.run()
dialog.window.destroy()
if rc == 1:
self._currentAction.exit_logger()
iutil.ipmi_report(IPMI_ABORTED)
sys.exit(0)
开发者ID:cyclefusion,项目名称:anaconda,代码行数:13,代码来源:__init__.py
示例11: parse_kickstart
def parse_kickstart(options, addon_paths):
"""Parse the input kickstart.
If we were given a kickstart file, parse (but do not execute) that now.
Otherwise, load in defaults from kickstart files shipped with the
installation media. Pick up any changes from interactive-defaults.ks
that would otherwise be covered by the dracut KS parser.
:param options: command line/boot options
:param dict addon_paths: addon paths dictionary
:returns: kickstart parsed to a data model
"""
ksdata = None
if options.ksfile and not options.liveinst:
if not os.path.exists(options.ksfile):
stdout_log.error("Kickstart file %s is missing.", options.ksfile)
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
flags.automatedInstall = True
flags.eject = False
ks_files = [options.ksfile]
elif os.path.exists("/run/install/ks.cfg") and not options.liveinst:
# this is to handle such cases where a user has pre-loaded a
# ks.cfg onto an OEMDRV labeled device
flags.automatedInstall = True
flags.eject = False
ks_files = ["/run/install/ks.cfg"]
else:
ks_files = ["/tmp/updates/interactive-defaults.ks",
"/usr/share/anaconda/interactive-defaults.ks"]
for ks in ks_files:
if not os.path.exists(ks):
continue
kickstart.preScriptPass(ks)
log.info("Parsing kickstart: " + ks)
ksdata = kickstart.parseKickstart(ks, options.ksstrict)
# Only load the first defaults file we find.
break
if not ksdata:
ksdata = kickstart.AnacondaKSHandler(addon_paths["ks"])
return ksdata
开发者ID:dougsland,项目名称:anaconda,代码行数:47,代码来源:startup_utils.py
示例12: postWriteHook
def postWriteHook(self, dump_info):
anaconda = dump_info.object
# See if there is a /root present in the root path and put exception there as well
if os.access(iutil.getSysroot() + "/root", os.X_OK):
try:
dest = iutil.getSysroot() + "/root/%s" % os.path.basename(self.exnFile)
shutil.copyfile(self.exnFile, dest)
except (shutil.Error, IOError):
log.error("Failed to copy %s to %s/root", self.exnFile, iutil.getSysroot())
# run kickstart traceback scripts (if necessary)
try:
kickstart.runTracebackScripts(anaconda.ksdata.scripts)
# pylint: disable=bare-except
except:
pass
iutil.ipmi_report(IPMI_FAILED)
开发者ID:josefbacik,项目名称:anaconda,代码行数:19,代码来源:exception.py
示例13: prompt_for_ssh
def prompt_for_ssh():
"""Prompt the user to ssh to the installation environment on the s390."""
# Do some work here to get the ip addr / hostname to pass
# to the user.
import socket
ip = network.getFirstRealIP()
if not ip:
stdout_log.error("No IP addresses found, cannot continue installation.")
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
ipstr = ip
try:
hinfo = socket.gethostbyaddr(ipstr)
except socket.herror as e:
stdout_log.debug("Exception caught trying to get host name of %s: %s", ipstr, e)
name = network.getHostname()
else:
if len(hinfo) == 3:
name = hinfo[0]
if ip.find(':') != -1:
ipstr = "[%s]" % (ip,)
if (name is not None) and (not name.startswith('localhost')) and (ipstr is not None):
connxinfo = "%s (%s)" % (socket.getfqdn(name=name), ipstr,)
elif ipstr is not None:
connxinfo = "%s" % (ipstr,)
else:
connxinfo = None
if connxinfo:
stdout_log.info(_("Please ssh [email protected]%s to begin the install."), connxinfo)
else:
stdout_log.info(_("Please ssh [email protected] to continue installation."))
开发者ID:dougsland,项目名称:anaconda,代码行数:39,代码来源:startup_utils.py
示例14: show_all
def show_all(self):
super().show_all()
from pyanaconda.installation import doInstall, doConfiguration
from pyanaconda.threading import threadMgr, AnacondaThread
thread_args = (self.storage, self.payload, self.data, self.instclass)
threadMgr.add(AnacondaThread(name=THREAD_INSTALL, target=doInstall, args=thread_args))
# This will run until we're all done with the install thread.
self._update_progress()
threadMgr.add(AnacondaThread(name=THREAD_CONFIGURATION, target=doConfiguration, args=thread_args))
# This will run until we're all done with the configuration thread.
self._update_progress()
iutil.ipmi_report(IPMI_FINISHED)
# kickstart install, continue automatically if reboot or shutdown selected
if flags.automatedInstall and self.data.reboot.action in [KS_REBOOT, KS_SHUTDOWN]:
# Just pretend like we got input, and our input doesn't care
# what it gets, it just quits.
raise ExitMainLoop()
开发者ID:jaymzh,项目名称:anaconda,代码行数:24,代码来源:installation_progress.py
示例15: input
def input(self, args, key):
"""Call IPMI ABORTED. Everything else will be done by original implementation."""
iutil.ipmi_report(IPMI_ABORTED)
super().input(args, key)
开发者ID:jaymzh,项目名称:anaconda,代码行数:4,代码来源:tuiobject.py
示例16: _earlyExceptionHandler
def _earlyExceptionHandler(ty, value, traceback):
iutil.ipmi_report(constants.IPMI_FAILED)
iutil.vtActivate(1)
return sys.__excepthook__(ty, value, traceback)
开发者ID:Jakuje,项目名称:anaconda,代码行数:4,代码来源:anaconda.py
示例17: install
def install(self):
mainctx = GLib.MainContext.new()
mainctx.push_thread_default()
cancellable = None
gi.require_version("OSTree", "1.0")
from gi.repository import OSTree
ostreesetup = self.data.ostreesetup
log.info("executing ostreesetup=%r", ostreesetup)
# Initialize the filesystem - this will create the repo as well
self._safeExecWithRedirect("ostree",
["admin", "--sysroot=" + iutil.getTargetPhysicalRoot(),
"init-fs", iutil.getTargetPhysicalRoot()])
self._sysroot_path = Gio.File.new_for_path(iutil.getTargetPhysicalRoot())
sysroot = OSTree.Sysroot.new(self._sysroot_path)
sysroot.load(cancellable)
repo = sysroot.get_repo(None)[1]
# We don't support resuming from interrupted installs
repo.set_disable_fsync(True)
self._remoteOptions = {}
if hasattr(ostreesetup, 'nogpg') and ostreesetup.nogpg:
self._remoteOptions['gpg-verify'] = GLib.Variant('b', False)
if flags.noverifyssl:
self._remoteOptions['tls-permissive'] = GLib.Variant('b', True)
repo.remote_change(None, OSTree.RepoRemoteChange.ADD_IF_NOT_EXISTS,
ostreesetup.remote, ostreesetup.url,
GLib.Variant('a{sv}', self._remoteOptions),
cancellable)
progressQ.send_message(_("Starting pull of %(branchName)s from %(source)s") % \
{"branchName": ostreesetup.ref, "source": ostreesetup.remote})
progress = OSTree.AsyncProgress.new()
progress.connect('changed', self._pullProgressCb)
try:
repo.pull(ostreesetup.remote, [ostreesetup.ref], 0, progress, cancellable)
except GLib.GError as e:
exn = PayloadInstallError("Failed to pull from repository: %s" % e)
log.error(str(exn))
if errors.errorHandler.cb(exn) == errors.ERROR_RAISE:
progressQ.send_quit(1)
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
progressQ.send_message(_("Preparing deployment of %s") % (ostreesetup.ref, ))
# Now that we have the data pulled, delete the remote for now.
# This will allow a remote configuration defined in the tree
# (if any) to override what's in the kickstart. Otherwise,
# we'll re-add it in post. Ideally, ostree would support a
# pull without adding a remote, but that would get quite
# complex.
repo.remote_delete(self.data.ostreesetup.remote, None)
self._safeExecWithRedirect("ostree",
["admin", "--sysroot=" + iutil.getTargetPhysicalRoot(),
"os-init", ostreesetup.osname])
admin_deploy_args = ["admin", "--sysroot=" + iutil.getTargetPhysicalRoot(),
"deploy", "--os=" + ostreesetup.osname]
admin_deploy_args.append(ostreesetup.remote + ':' + ostreesetup.ref)
log.info("ostree admin deploy starting")
progressQ.send_message(_("Deployment starting: %s") % (ostreesetup.ref, ))
self._safeExecWithRedirect("ostree", admin_deploy_args)
log.info("ostree admin deploy complete")
progressQ.send_message(_("Deployment complete: %s") % (ostreesetup.ref, ))
# Reload now that we've deployed, find the path to the new deployment
sysroot.load(None)
deployments = sysroot.get_deployments()
assert len(deployments) > 0
deployment = deployments[0]
deployment_path = sysroot.get_deployment_directory(deployment)
iutil.setSysroot(deployment_path.get_path())
try:
self._copyBootloaderData()
except (OSError, RuntimeError) as e:
exn = PayloadInstallError("Failed to copy bootloader data: %s" % e)
log.error(str(exn))
if errors.errorHandler.cb(exn) == errors.ERROR_RAISE:
progressQ.send_quit(1)
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
mainctx.pop_thread_default()
开发者ID:rtruxal,项目名称:anaconda,代码行数:96,代码来源:rpmostreepayload.py
示例18: check_memory
def check_memory(anaconda, options, display_mode=None):
"""Check is the system has enough RAM for installation.
:param anaconda: instance of the Anaconda class
:param options: command line/boot options
:param display_mode: a display mode to use for the check
(graphical mode usually needs more RAM, etc.)
"""
from pyanaconda import isys
reason_strict = _("%(product_name)s requires %(needed_ram)s MB of memory to "
"install, but you only have %(total_ram)s MB on this machine.\n")
reason_graphical = _("The %(product_name)s graphical installer requires %(needed_ram)s "
"MB of memory, but you only have %(total_ram)s MB\n.")
reboot_extra = _('\n'
'Press [Enter] to reboot your system.\n')
livecd_title = _("Not enough RAM")
livecd_extra = _(" Try the text mode installer by running:\n\n"
"'/usr/bin/liveinst -T'\n\n from a root terminal.")
nolivecd_extra = _(" Starting text mode.")
# skip the memory check in rescue mode
if options.rescue:
return
if not display_mode:
display_mode = anaconda.display_mode
reason = reason_strict
total_ram = int(isys.total_memory() / 1024)
needed_ram = int(isys.MIN_RAM)
graphical_ram = int(isys.MIN_GUI_RAM)
# count the squashfs.img in if it is kept in RAM
if not iutil.persistent_root_image():
needed_ram += isys.SQUASHFS_EXTRA_RAM
graphical_ram += isys.SQUASHFS_EXTRA_RAM
log.info("check_memory(): total:%s, needed:%s, graphical:%s",
total_ram, needed_ram, graphical_ram)
if not options.memcheck:
log.warning("CHECK_MEMORY DISABLED")
return
reason_args = {"product_name": product.productName,
"needed_ram": needed_ram,
"total_ram": total_ram}
if needed_ram > total_ram:
if options.liveinst:
# pylint: disable=logging-not-lazy
stdout_log.warning(reason % reason_args)
gtk_warning(livecd_title, reason % reason_args)
else:
reason += reboot_extra
print(reason % reason_args)
print(_("The installation cannot continue and the system will be rebooted"))
print(_("Press ENTER to continue"))
input()
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
# override display mode if machine cannot nicely run X
if display_mode != constants.DisplayModes.TUI and not flags.usevnc:
needed_ram = graphical_ram
reason_args["needed_ram"] = graphical_ram
reason = reason_graphical
if needed_ram > total_ram:
if options.liveinst:
reason += livecd_extra
# pylint: disable=logging-not-lazy
stdout_log.warning(reason % reason_args)
title = livecd_title
gtk_warning(title, reason % reason_args)
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
else:
reason += nolivecd_extra
# pylint: disable=logging-not-lazy
stdout_log.warning(reason % reason_args)
anaconda.display_mode = constants.DisplayModes.TUI
time.sleep(2)
开发者ID:dougsland,项目名称:anaconda,代码行数:86,代码来源:startup_utils.py
示例19: getAnacondaVersionString
log.info("%s %s", sys.argv[0], getAnacondaVersionString())
if os.path.exists("/tmp/updates"):
log.info("Using updates in /tmp/updates/ from %s", opts.updateSrc)
# TODO: uncomment this when we're sure that we're doing the right thing
# with flags.cmdline *everywhere* it appears...
#for arg in depr:
# stdoutLog.warn("Boot argument '%s' is deprecated. "
# "In the future, use 'inst.%s'.", arg, arg)
# pull this in to get product name and versioning
from pyanaconda import product
from pyanaconda import isys
iutil.ipmi_report(constants.IPMI_STARTED)
if (opts.images or opts.dirinstall) and opts.liveinst:
stdoutLog.error("--liveinst cannot be used with --images or --dirinstall")
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
if opts.images and opts.dirinstall:
stdoutLog.error("--images and --dirinstall cannot be used at the same time")
iutil.ipmi_report(constants.IPMI_ABORTED)
sys.exit(1)
elif opts.dirinstall:
root_path = opts.dirinstall
iutil.setTargetPhysicalRoot(root_path)
iutil.setSysroot(root_path)
开发者ID:Jakuje,项目名称:anaconda,代码行数:30,代码来源:anaconda.py
示例20: tui_quit_callback
def tui_quit_callback(data):
ipmi_report(IPMI_ABORTED)
开发者ID:jaymzh,项目名称:anaconda,代码行数:2,代码来源:__init__.py
注:本文中的pyanaconda.iutil.ipmi_report函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论