If thats the case why are you iterating through dirs?

Aldo, glob returns a list of matches.


Pedro Algarvio @ Phone

----- Reply message -----
From: "pille" <notifications@github.com>
To: "saltstack/salt" <salt@noreply.github.com>
Cc: "Pedro Algarvio" <pedro@algarvio.me>
Subject: [salt] add grain that detects SSDs (#11536)
Date: Wed, Mar 26, 2014 13:54
In salt/grains/ssds.py: 
> +''' 
> +import os 
> +import salt.utils 
> +import logging 
> + 
> +log = logging.getLogger(__name__) 
> + 
> +def ssds(): 
> +    ''' 
> +    Return list of disk devices that are SSD (non-rotational) 
> +    ''' 
> + 
> +    SSDs = [] 
> +    for subdir, dirs, files in os.walk('/sys/block'): 
> +        for dir in dirs: 
> +            flagfile = subdir + '/' + dir + '/queue/rotational' 

the path should be /sys/block/*/queue/rotational

so how do i access the substitution for the asterisk? 

&mdash;
Reply to this email directly or view it on GitHub.