def _extract_attached_to(disk):
 users = disk.get('users', [])
 if (not users):
  return None
 if (len(users) > 1):
  raise GCEVolumeException('Volume is attached to more than one instance:{}'.format(disk))
 return unicode(users[0].split('/')[(-1)])

def _extract_attached_to ( disk ) : users = disk . get ( 'users' , [ ] ) if ( not users ) : return None if ( len ( users ) > 1 ) : raise GCEVolumeException ( 'Volume is attached to more than one instance:{}' . format ( disk ) ) return unicode ( users [ 0 ] . split ( '/' ) [ ( - 1 ) ] )
given a gce disk resource .