当前位置: 首页>>代码示例>>Python>>正文


Python conf.DEFAULT_USER类代码示例

本文整理汇总了Python中desktop.conf.DEFAULT_USER的典型用法代码示例。如果您正苦于以下问题:Python DEFAULT_USER类的具体用法?Python DEFAULT_USER怎么用?Python DEFAULT_USER使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DEFAULT_USER类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_params

  def _get_params(self):
    params = {}

    if self.username != DEFAULT_USER.get(): # We impersonate if needed
      params['doAs'] = self.username
      if not self.security_enabled:
        params['user.name'] = DEFAULT_USER.get()

    return params
开发者ID:277800076,项目名称:hue,代码行数:9,代码来源:resource_manager_api.py

示例2: getuser

 def getuser(self, **options):
   try:
     return User.objects.get(id=1)
   except User.DoesNotExist:
     form = SuperUserChangeForm(
       {
         "username": DEFAULT_USER.get(),
         "password1": DEFAULT_USER_PASSWORD.get(),
         "password2": DEFAULT_USER_PASSWORD.get(),
         "ensure_home_directory": True,
         "is_active": True,
         "is_superuser": True,
       }
     )
     instance = form.save()
     get_profile(instance)
     return User.objects.get(username=DEFAULT_USER.get())
开发者ID:OpenPOWER-BigData,项目名称:HDP-hue,代码行数:17,代码来源:create_sandbox_user.py

示例3: handle_noargs

    def handle_noargs(self, **options):
        try:
            user = User.objects.get(username=DEFAULT_USER.get())
        except User.DoesNotExist:
            from useradmin.management.commands.create_sandbox_user import Command
            Command().handle_noargs()
            user = User.objects.get(username=DEFAULT_USER.get())
        error_list = _get_config_errors(user)
        error_message = ""
        for confvar, error in error_list:
            if isinstance(confvar, str):
                cv = confvar
            else:
                cv = confvar.get_fully_qualifying_key()
            error_message += "\n--Variable: %s\n--Current value: %s\n--Error: %s\n" % (cv, confvar, error)

        if error_message:
            sys.stderr.write("Possible missconfigurations: \n %s \n" % error_message)
            sys.exit(1)
        else:
            sys.stdout.write("Smoke test passed \n")
            sys.exit(0)
开发者ID:OpenPOWER-BigData,项目名称:HDP-hue,代码行数:22,代码来源:smoke_test.py

示例4: extract_archive_in_hdfs

def extract_archive_in_hdfs(request, upload_path, file_name):
  _upload_extract_archive_script_to_hdfs(request.fs)

  output_path = upload_path + '/' + file_name.split('.')[0]
  start_time = json.loads(request.POST.get('start_time', '-1'))

  shell_notebook = Notebook(
      name=_('HDFS Extraction of %(upload_path)s/%(file_name)s') % {'upload_path': upload_path, 'file_name': file_name},
      isManaged=True,
      onSuccessUrl=reverse('filebrowser.views.view', kwargs={'path': output_path})
  )

  shell_notebook.add_shell_snippet(
      shell_command='extract_archive_in_hdfs.sh',
      arguments=[{'value': '-u=' + upload_path}, {'value': '-f=' + file_name}, {'value': '-o=' + output_path}],
      archives=[],
      files=[{'value': '/user/' + DEFAULT_USER.get() + '/common/extract_archive_in_hdfs.sh'}, {"value": upload_path + '/' + urllib.quote(file_name)}],
      env_var=[{'value': 'HADOOP_USER_NAME=${wf:user()}'}],
      last_executed=start_time
  )

  return shell_notebook.execute(request, batch=True)
开发者ID:cloudera,项目名称:hue,代码行数:22,代码来源:extract_utils.py

示例5: compress_files_in_hdfs

def compress_files_in_hdfs(request, file_names, upload_path, archive_name):

  _upload_compress_files_script_to_hdfs(request.fs)

  files = [{"value": upload_path + '/' + file_name} for file_name in file_names]
  files.append({'value': '/user/' + DEFAULT_USER.get() + '/common/compress_files_in_hdfs.sh'})
  start_time = json.loads(request.POST.get('start_time', '-1'))

  shell_notebook = Notebook(
    name=_('HDFS Compression to %(upload_path)s/hue_compressed.zip') % {'upload_path': upload_path},
    isManaged=True,
    onSuccessUrl=reverse('filebrowser.views.view', kwargs={'path': upload_path})
  )

  shell_notebook.add_shell_snippet(
      shell_command='compress_files_in_hdfs.sh',
      arguments=[{'value': '-u=' + upload_path}, {'value': '-f=' + ','.join(file_names)}, {'value': '-n=' + archive_name}],
      archives=[],
      files=files,
      env_var=[{'value': 'HADOOP_USER_NAME=${wf:user()}'}],
      last_executed=start_time
  )

  return shell_notebook.execute(request, batch=True)
开发者ID:cloudera,项目名称:hue,代码行数:24,代码来源:compress_utils.py

示例6: HiveServerTable

  TExecuteStatementReq, TGetOperationStatusReq, TFetchOrientation,\
  TCloseSessionReq, TGetSchemasReq, TGetLogReq, TCancelOperationReq,\
  TCloseOperationReq, TFetchResultsResp, TRowSet, TProtocolVersion

from beeswax import conf as beeswax_conf
from beeswax import hive_site
from beeswax.hive_site import hiveserver2_use_ssl
from beeswax.models import Session, HiveServerQueryHandle, HiveServerQueryHistory
from beeswax.server.dbms import Table, NoSuchObjectException, DataTable,\
                                QueryServerException


LOG = logging.getLogger(__name__)

IMPALA_RESULTSET_CACHE_SIZE = 'impala.resultset.cache.size'
DEFAULT_USER = DEFAULT_USER.get()


class HiveServerTable(Table):
  """
  We get the table details from a DESCRIBE FORMATTED.
  """

  def __init__(self, table_results, table_schema, desc_results, desc_schema):
    if beeswax_conf.THRIFT_VERSION.get() >= 7:
      if not table_results.columns:
        raise NoSuchObjectException()
      self.table = table_results.columns
    else: # Deprecated. To remove in Hue 4.
      if not table_results.rows:
        raise NoSuchObjectException()
开发者ID:QLGu,项目名称:hue,代码行数:31,代码来源:hive_server2_lib.py

示例7: username

 def username(self):
   try:
     return self._thread_local.user
   except AttributeError:
     return DEFAULT_USER.get()
开发者ID:277800076,项目名称:hue,代码行数:5,代码来源:resource_manager_api.py


注:本文中的desktop.conf.DEFAULT_USER类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。