2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-17 18:11:10 +00:00
Files
build-utils
docs
java-xCAT
perl-xCAT
src
xCAT
xCAT-IBMhpc
xCAT-OpenStack
xCAT-OpenStack-baremetal
xCAT-OpenStack-ironic
xCAT-SoftLayer
xCAT-UI
xCAT-buildkit
xCAT-client
xCAT-confluent
xCAT-csm
xCAT-genesis-builder
xCAT-genesis-scripts
xCAT-openbmc-py
xCAT-probe
xCAT-rmc
xCAT-server
xCAT-test
xCAT-vlan
xCATsn
.gitignore
.mailmap
.travis.yml
README.rst
Release
Version
build-python-deb
build-ubunturepo
buildcore.sh
builddep.sh
buildlocal.sh
comps.xml
create_man_pages.py
makerpm
makerpm-genesisbuilder
pull_request_template.md
travis.pl
xcat-core/xCAT-openbmc-py/lib/python/agent/hwctl/flash.py

55 lines
1.7 KiB
Python

#!/usr/bin/env python
###############################################################################
# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html
###############################################################################
# -*- coding: utf-8 -*-
#
class FlashInterface(object):
"""Interface for flash-related actions."""
interface_type = 'flash'
version = '1.0'
def activate_firm(self, task, activate_arg):
"""Activate firmware.
:param task: a Task instance containing the nodes to act on.
:activate_arg: arg for activate
"""
return task.run('activate_firm', activate_arg)
def delete_firm(self, task, delete_id):
"""Delete firmware.
:param task: a Task instance containing the nodes to act on.
:param delete_id: firmware id want to delete
"""
return task.run('delete_firm', delete_id)
def flash_process(self, task, directory, no_host_reboot):
"""Upload and activate firmware
:param task: a Task instance containing the nodes to act on.
:directory: firmware directory
"""
return task.run('flash_process', directory, no_host_reboot)
def list_firm_info(self, task):
"""List firmware
:param task: a Task instance containing the nodes to act on.
"""
return task.run('list_firm_info')
def upload_firm(self, task, upload_file):
"""Upload firmware file.
:param task: a Task instance containing the nodes to act on.
:param upload_file: the file want to upload
"""
return task.run('upload_firm', upload_file)
class DefaultFlashManager(FlashInterface):
"""Interface for flash-related actions."""
pass