def get_osarch():
    '''
    Get the os architecture using rpm --eval
    '''
    if salt.utils.path.which('rpm'):
        ret = subprocess.Popen(
            'rpm --eval "%{_host_cpu}"',
            shell=True,
            close_fds=True,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE).communicate()[0]
    else:
        ret = ''.join([x for x in platform.uname()[-2:] if x][-1:])

    return salt.utils.stringutils.to_str(ret).strip() or 'unknown'
def get_osarch ( ) : if salt . utils . path . which ( 'rpm' ) : ret = subprocess . Popen ( 'rpm --eval "%{_host_cpu}"' , shell = True , close_fds = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) . communicate ( ) [ 0 ] else : ret = '' . join ( [ x for x in platform . uname ( ) [ - 2 : ] if x ] [ - 1 : ] ) return salt . utils . stringutils . to_str ( ret ) . strip ( ) or 'unknown'
Get the os architecture using rpm --eval