tools/bdconfig/lib/google_hadoop/bdconfig_lib/path_validator.py
def AbsoluteHDFSUri(uri):
  """Validates that the given path is absolute and looks like an HDFS path."""
  if uri is None:
    # Value is allowed to not be set
    return True
  components = urlparse.urlparse(uri)
  if components.scheme != 'hdfs':
    raise flags_validators.Error(
        'The given path must use hdfs scheme: ' + uri)
  elif not components.path.startswith('/'):
    raise flags_validators.Error(
        'The given HDFS path must be absolute: ' + uri)
  elif not components.hostname:
    raise flags_validators.Error(
        'The given HDFS path contain host name: ' + uri)
  elif not components.port:
    raise flags_validators.Error(
        'The given HDFS path contain port number: ' + uri)
  else:
    return True
Validates that the given path is absolute and looks like an HDFS path.
Validates that the given path is absolute and looks like an HDFS path.
Validates that the given path is absolute and looks like an HDFS path .
def AbsoluteHDFSUri(uri):
  if uri is None:
    return True
  components = urlparse.urlparse(uri)
  if components.scheme != 'hdfs':
    raise flags_validators.Error(
        'The given path must use hdfs scheme: ' + uri)
  elif not components.path.startswith('/'):
    raise flags_validators.Error(
        'The given HDFS path must be absolute: ' + uri)
  elif not components.hostname:
    raise flags_validators.Error(
        'The given HDFS path contain host name: ' + uri)
  elif not components.port:
    raise flags_validators.Error(
        'The given HDFS path contain port number: ' + uri)
  else:
    return True
def AbsoluteHDFSUri ( uri ) : if uri is None : return True components = urlparse . urlparse ( uri ) if components . scheme != 'hdfs' : raise flags_validators . Error ( 'The given path must use hdfs scheme: ' + uri ) elif not components . path . startswith ( '/' ) : raise flags_validators . Error ( 'The given HDFS path must be absolute: ' + uri ) elif not components . hostname : raise flags_validators . Error ( 'The given HDFS path contain host name: ' + uri ) elif not components . port : raise flags_validators . Error ( 'The given HDFS path contain port number: ' + uri ) else : return True
Validates that the given path is absolute and looks like an HDFS path.
Validates that the given path is absolute and looks like an HDFS path .
"""Validates that the given path is absolute and looks like an HDFS path.""" # Value is allowed to not be set
uri