def _assert_vhd_not_hidden(path):
 query_cmd = ('vhd-util query -n %(path)s -f' % locals())
 query_proc = make_subprocess(query_cmd, stdout=True, stderr=True)
 (out, err) = finish_subprocess(query_proc, query_cmd)
 for line in out.splitlines():
  if line.startswith('hidden'):
   value = line.split(':')[1].strip()
   if (value == '1'):
    raise Exception(('VHD %(path)s is marked as hidden without child' % locals()))

def _assert_vhd_not_hidden ( path ) : query_cmd = ( 'vhd-util query -n %(path)s -f' % locals ( ) ) query_proc = make_subprocess ( query_cmd , stdout = True , stderr = True ) ( out , err ) = finish_subprocess ( query_proc , query_cmd ) for line in out . splitlines ( ) : if line . startswith ( 'hidden' ) : value = line . split ( ':' ) [ 1 ] . strip ( ) if ( value == '1' ) : raise Exception ( ( 'VHD %(path)s is marked as hidden without child' % locals ( ) ) )
sanity check to ensure that only appropriate vhds are marked as hidden .