Merge "Retrieve device image over lighttpd"
This commit is contained in:
commit
62f18d3cce
@ -40,7 +40,6 @@ from glob import glob
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
import shutil
|
|
||||||
import time
|
import time
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
@ -140,20 +139,6 @@ def fetch_device_image(filename):
|
|||||||
return local_path
|
return local_path
|
||||||
|
|
||||||
|
|
||||||
def fetch_device_image_local(filename):
|
|
||||||
# This is a hack since we only support AIO for now. Just copy the device
|
|
||||||
# image file into the well-known device image cache directory.
|
|
||||||
local_path = DEVICE_IMAGE_CACHE_DIR + "/" + filename
|
|
||||||
image_file_path = os.path.join(dconstants.DEVICE_IMAGE_PATH, filename)
|
|
||||||
try:
|
|
||||||
shutil.copyfile(image_file_path, local_path)
|
|
||||||
except (shutil.Error, IOError):
|
|
||||||
msg = ("Unable to retrieve device image from %s!" % image_file_path)
|
|
||||||
LOG.exception(msg)
|
|
||||||
raise exception.SysinvException(msg)
|
|
||||||
return local_path
|
|
||||||
|
|
||||||
|
|
||||||
def write_device_image_n3000(filename, pci_addr):
|
def write_device_image_n3000(filename, pci_addr):
|
||||||
# Write the firmware image to the FPGA at the specified PCI address.
|
# Write the firmware image to the FPGA at the specified PCI address.
|
||||||
# We're assuming that the image update tools will catch the scenario
|
# We're assuming that the image update tools will catch the scenario
|
||||||
@ -607,15 +592,9 @@ class FpgaAgentManager(service.PeriodicService):
|
|||||||
LOG.info("ensure device image cache exists")
|
LOG.info("ensure device image cache exists")
|
||||||
ensure_device_image_cache_exists()
|
ensure_device_image_cache_exists()
|
||||||
|
|
||||||
# Pull the image from the controller.
|
# Pull the image from the controller via HTTP
|
||||||
LOG.info("fetch device image %s" % filename)
|
LOG.info("fetch device image %s" % filename)
|
||||||
# For now, we only need to support AIO nodes, so just copy the
|
local_path = fetch_device_image(filename)
|
||||||
# file from where we know sysinv-conductor put it.
|
|
||||||
local_path = fetch_device_image_local(filename)
|
|
||||||
|
|
||||||
# TODO: when we need to support standalone workers, we'll need to
|
|
||||||
# pull in the image file via HTTP.
|
|
||||||
# local_path = fetch_device_image(filename)
|
|
||||||
|
|
||||||
# TODO: check CSK used to sign image, ensure it hasn't been cancelled
|
# TODO: check CSK used to sign image, ensure it hasn't been cancelled
|
||||||
# TODO: check root key used to sign image, ensure it matches root key of hardware
|
# TODO: check root key used to sign image, ensure it matches root key of hardware
|
||||||
|
Loading…
Reference in New Issue
Block a user