def get_osarch():
 ret = subprocess.Popen('rpm --eval "%{_host_cpu}"', shell=True, close_fds=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
 return (ret or 'unknown')

def get_osarch ( ) : ret = subprocess . Popen ( 'rpm --eval "%{_host_cpu}"' , shell = True , close_fds = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) . communicate ( ) [ 0 ] return ( ret or 'unknown' )
get the os architecture using rpm --eval .