Пример #1
0
 def destroy(self):
     # TODO(ralonsoh): once the issue in LP#1838793 is properly fixed, we
     # can remove this workaround (TestTimer context).
     with helpers.TestTimer(5):
         try:
             if self.ip_wrapper.netns.exists(self.name):
                 for pid in ip_lib.list_namespace_pids(self.name):
                     utils.kill_process(pid, signal.SIGKILL,
                                        run_as_root=True,
                                        extra_ok_codes=[errno.ESRCH])
                 self.ip_wrapper.netns.delete(self.name)
         except helpers.TestTimerTimeout:
             LOG.warning('Namespace %s was not deleted due to a timeout.',
                         self.name)
Пример #2
0
 def destroy(self):
     if self.ip_wrapper.netns.exists(self.name):
         for pid in ip_lib.list_namespace_pids(self.name):
             utils.kill_process(pid, signal.SIGKILL, run_as_root=True)
         self.ip_wrapper.netns.delete(self.name)