def test_join_non_strings(self): self.assertEqual(utils.join_non_strings(':'), '') self.assertEqual(utils.join_non_strings(':', 'a'), 'a') self.assertEqual(utils.join_non_strings(':', 'a', 2, 'c'), 'a:2:c') self.assertEqual(utils.join_non_strings(':', ['a', 2, 'c']), 'a:2:c') self.assertEqual(utils.join_non_strings(':', 'abc'), 'abc')
def start(self, cores): """ start specific cores on the remote instance """ LOG.debug("Starting cores %s", cores) self.put_command("start {}\n".format(join_non_strings(',', cores))) time.sleep(3)
def format_ports_for_reassignment(ports): formatted = [join_non_strings(';', p) for p in ports if len(p) == 3] LOG.debug('for client ports:%s', os.linesep.join(formatted)) return formatted
def stop(self, cores, task=''): """ stop specific cores on the remote instance """ LOG.debug("Stopping cores %s", cores) self.put_command("stop {} {}\n".format(join_non_strings(',', cores), task)) time.sleep(3)