Execute a salt-ssh call synchronously. .. versionadded:: 2015.5.0 WARNING: Eauth is **NOT** respected .. code-block:: python client.cmd_sync({ 'tgt': 'silver', 'fun': 'test.ping', 'arg': (),
(self, low)
| 169 | return final |
| 170 | |
| 171 | def cmd_sync(self, low): |
| 172 | """ |
| 173 | Execute a salt-ssh call synchronously. |
| 174 | |
| 175 | .. versionadded:: 2015.5.0 |
| 176 | |
| 177 | WARNING: Eauth is **NOT** respected |
| 178 | |
| 179 | .. code-block:: python |
| 180 | |
| 181 | client.cmd_sync({ |
| 182 | 'tgt': 'silver', |
| 183 | 'fun': 'test.ping', |
| 184 | 'arg': (), |
| 185 | 'tgt_type'='glob', |
| 186 | 'kwarg'={} |
| 187 | }) |
| 188 | {'silver': {'fun_args': [], 'jid': '20141202152721523072', 'return': True, 'retcode': 0, 'success': True, 'fun': 'test.ping', 'id': 'silver'}} |
| 189 | """ |
| 190 | |
| 191 | kwargs = copy.deepcopy(low) |
| 192 | |
| 193 | for ignore in ["tgt", "fun", "arg", "timeout", "tgt_type", "kwarg"]: |
| 194 | if ignore in kwargs: |
| 195 | del kwargs[ignore] |
| 196 | |
| 197 | return self.cmd( |
| 198 | low["tgt"], |
| 199 | low["fun"], |
| 200 | low.get("arg", []), |
| 201 | low.get("timeout"), |
| 202 | low.get("tgt_type"), |
| 203 | low.get("kwarg"), |
| 204 | **kwargs, |
| 205 | ) |
| 206 | |
| 207 | def cmd_async(self, low, timeout=None): |
| 208 | """ |