示例#1
0
 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')
示例#2
0
文件: nvmet.py 项目: mahak/cinder
 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')