def test_get_configured_config_dir(self, get_mock):
     non_default_directory = '/not/the/default'
     get_mock.return_value = non_default_directory
     self.assertEqual(local_config_util.get_config_directory(),
                      non_default_directory)
Пример #2
0
"""

import os

from overrides import overrides

from fabric.state import env

from prestoadmin.util.base_config import BaseConfig, SingleConfigItem, \
    MultiConfigItem
from prestoadmin.util.local_config_util import get_config_directory
from prestoadmin.util.validators import validate_host, validate_port, \
    validate_username, validate_can_connect, validate_can_sudo

SLIDER_CONFIG_LOADED = 'slider_config_loaded'
SLIDER_CONFIG_DIR = os.path.join(get_config_directory(), 'slider')
SLIDER_CONFIG_PATH = os.path.join(SLIDER_CONFIG_DIR, 'config.json')
SLIDER_MASTER = 'slider_master'

HOST = 'slider_master'
ADMIN_USER = '******'
SSH_PORT = 'ssh_port'

DIR = 'slider_directory'
APPNAME = 'slider_appname'
INSTANCE_NAME = 'slider_instname'
SLIDER_USER = '******'
JAVA_HOME = 'JAVA_HOME'
HADOOP_CONF = 'HADOOP_CONF'

# This key comes from the server install step, NOT a user prompt. Accordingly,
 def test_get_default_config_dir(self, get_mock):
     get_mock.return_value = None
     self.assertEqual(local_config_util.get_config_directory(),
                      DEFAULT_LOCAL_CONF_DIR)
Пример #4
0
"""
Module for handling presto-admin mode-related functionality.
"""

import os

from fabric.api import abort, task
from fabric.decorators import runs_once

from prestoadmin import config
from prestoadmin.util.exception import ConfigurationError, \
    ConfigFileNotFoundError
from prestoadmin.util.local_config_util import get_config_directory

MODE_CONF_PATH = os.path.join(get_config_directory(), 'mode.json')
MODE_KEY = 'mode'

MODE_SLIDER = 'yarn_slider'
MODE_STANDALONE = 'standalone'

VALID_MODES = [MODE_SLIDER, MODE_STANDALONE]


def _load_mode_config():
    return config.get_conf_from_json_file(MODE_CONF_PATH)


def _store_mode_config(mode_config):
    config.write(config.json_to_string(mode_config), MODE_CONF_PATH)
Пример #5
0
# limitations under the License.
"""
Module for handling presto-admin mode-related functionality.
"""

import os

from fabric.api import abort, task
from fabric.decorators import runs_once

from prestoadmin import config
from prestoadmin.util.exception import ConfigurationError, \
    ConfigFileNotFoundError
from prestoadmin.util.local_config_util import get_config_directory

MODE_CONF_PATH = os.path.join(get_config_directory(), 'mode.json')
MODE_KEY = 'mode'

MODE_SLIDER = 'yarn_slider'
MODE_STANDALONE = 'standalone'

VALID_MODES = [MODE_SLIDER, MODE_STANDALONE]


def _load_mode_config():
    return config.get_conf_from_json_file(MODE_CONF_PATH)


def _store_mode_config(mode_config):
    config.write(config.json_to_string(mode_config), MODE_CONF_PATH)
Пример #6
0
"""

import os

from overrides import overrides

from fabric.state import env

from prestoadmin.util.base_config import BaseConfig, SingleConfigItem, \
    MultiConfigItem
from prestoadmin.util.local_config_util import get_config_directory
from prestoadmin.util.validators import validate_host, validate_port, \
    validate_username, validate_can_connect, validate_can_sudo

SLIDER_CONFIG_LOADED = 'slider_config_loaded'
SLIDER_CONFIG_DIR = os.path.join(get_config_directory(), 'slider')
SLIDER_CONFIG_PATH = os.path.join(SLIDER_CONFIG_DIR, 'config.json')
SLIDER_MASTER = 'slider_master'

HOST = 'slider_master'
ADMIN_USER = '******'
SSH_PORT = 'ssh_port'

DIR = 'slider_directory'
APPNAME = 'slider_appname'
INSTANCE_NAME = 'slider_instname'
SLIDER_USER = '******'
JAVA_HOME = 'JAVA_HOME'
HADOOP_CONF = 'HADOOP_CONF'

# This key comes from the server install step, NOT a user prompt. Accordingly,
 def test_get_configured_config_dir(self, get_mock):
     non_default_directory = '/not/the/default'
     get_mock.return_value = non_default_directory
     self.assertEqual(local_config_util.get_config_directory(), non_default_directory)
 def test_get_default_config_dir(self, get_mock):
     get_mock.return_value = None
     self.assertEqual(local_config_util.get_config_directory(), DEFAULT_LOCAL_CONF_DIR)