I think that ``tar xfv <file>`` opens anything in these  - tar, gz, bz2, xz - as it is with no fuss.

E. g. :
```python
if re.search(r"((gzip|XZ|bzip2) compressed data|POSIX tar)", out):
    status, out = client.run_command('tar xvf %s' % filename)
else:
    # error
```

Or just (more pythonic and shorter):
```python
status, out = client.run_command('tar xvf %s' % filename)
if out != 0:
    # error
```
If the check has some deeper meaning, then please ignore this comment :smiley: