```python
import glob

glob.glob('/sys/block/*/*/queue/rotational')
```
I don't have SSD's so I can't test but the above should work... Does it work?