def _restore(self, nvmf_subsystems): # Dump updated JSON dict to append new subsystem with tempfile.NamedTemporaryFile(mode='w') as tmp_fd: tmp_fd.write(json.dumps(nvmf_subsystems)) tmp_fd.flush() try: out, err = nvmcli.restore(tmp_fd.name) except putils.ProcessExecutionError: with excutils.save_and_reraise_exception(): LOG.exception('Error from nvmetcli restore')
def _restore(self, nvmf_subsystems): # Dump updated JSON dict to append new subsystem with tempfile.NamedTemporaryFile() as tmp_fd: tmp_fd.write(json.dumps(nvmf_subsystems)) tmp_fd.flush() try: out, err = nvmcli.restore(tmp_fd.name) except putils.ProcessExecutionError: with excutils.save_and_reraise_exception(): LOG.exception('Error from nvmetcli restore')