def real_path_to_hdfs_uri(real_path, environ):
 hdfs_root = get_mock_hdfs_root(environ=environ)
 if (not real_path.startswith(hdfs_root)):
  raise ValueError(('path %s is not in %s' % (real_path, hdfs_root)))
 hdfs_uri = real_path[len(hdfs_root):]
 if (not hdfs_uri.startswith('/')):
  hdfs_uri = ('/' + hdfs_uri)
 return hdfs_uri

def real_path_to_hdfs_uri ( real_path , environ ) : hdfs_root = get_mock_hdfs_root ( environ = environ ) if ( not real_path . startswith ( hdfs_root ) ) : raise ValueError ( ( 'path %s is not in %s' % ( real_path , hdfs_root ) ) ) hdfs_uri = real_path [ len ( hdfs_root ) : ] if ( not hdfs_uri . startswith ( '/' ) ) : hdfs_uri = ( '/' + hdfs_uri ) return hdfs_uri
map a real path to an hdfs:/// uri .