Run a Ceph command and return the object representing the process for the command. Accepts arguments same as that of teuthology.orchestra.run.run()
(self, **kwargs)
| 1669 | return self.run_cluster_cmd(args=args, stdout=stdout, stderr=stderr, **kwargs) |
| 1670 | |
| 1671 | def run_cluster_cmd(self, **kwargs): |
| 1672 | """ |
| 1673 | Run a Ceph command and return the object representing the process |
| 1674 | for the command. |
| 1675 | |
| 1676 | Accepts arguments same as that of teuthology.orchestra.run.run() |
| 1677 | """ |
| 1678 | if isinstance(kwargs['args'], str): |
| 1679 | kwargs['args'] = shlex.split(kwargs['args']) |
| 1680 | elif isinstance(kwargs['args'], tuple): |
| 1681 | kwargs['args'] = list(kwargs['args']) |
| 1682 | |
| 1683 | prefixcmd = [] |
| 1684 | timeoutcmd = kwargs.pop('timeoutcmd', None) |
| 1685 | if timeoutcmd is not None: |
| 1686 | prefixcmd += ['timeout', str(timeoutcmd)] |
| 1687 | |
| 1688 | if self.cephadm: |
| 1689 | prefixcmd += ['ceph'] |
| 1690 | cmd = prefixcmd + list(kwargs['args']) |
| 1691 | return shell(self.ctx, self.cluster, self.controller, |
| 1692 | args=cmd, |
| 1693 | stdout=StringIO(), |
| 1694 | check_status=kwargs.get('check_status', True)) |
| 1695 | elif self.rook: |
| 1696 | prefixcmd += ['ceph'] |
| 1697 | cmd = prefixcmd + list(kwargs['args']) |
| 1698 | return toolbox(self.ctx, self.cluster, |
| 1699 | args=cmd, |
| 1700 | stdout=StringIO(), |
| 1701 | check_status=kwargs.get('check_status', True)) |
| 1702 | else: |
| 1703 | kwargs['args'] = prefixcmd + self.get_ceph_cmd(**kwargs) + kwargs['args'] |
| 1704 | return self.controller.run(**kwargs) |
| 1705 | |
| 1706 | def raw_cluster_cmd(self, *args, **kwargs) -> str: |
| 1707 | """ |