|
@@ -17,44 +17,58 @@
|
|
|
|
|
|
|
|
import os.path
|
|
import os.path
|
|
|
|
|
|
|
|
-from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
|
|
+from django.utils.translation import ugettext as _, ugettext_lazy as _t
|
|
|
|
|
|
|
|
from desktop.lib.conf import Config, coerce_bool
|
|
from desktop.lib.conf import Config, coerce_bool
|
|
|
from desktop.lib import paths
|
|
from desktop.lib import paths
|
|
|
|
|
+from liboozie.conf import get_oozie_status
|
|
|
|
|
+
|
|
|
|
|
+from oozie.settings import NICE_NAME
|
|
|
|
|
|
|
|
|
|
|
|
|
DEFINITION_XSLT_DIR = Config(
|
|
DEFINITION_XSLT_DIR = Config(
|
|
|
key="definition_xslt_dir",
|
|
key="definition_xslt_dir",
|
|
|
default=os.path.join(os.path.dirname(__file__), "xslt"),
|
|
default=os.path.join(os.path.dirname(__file__), "xslt"),
|
|
|
- help=_("Location on local FS where the xslt files are stored for workflow import."),
|
|
|
|
|
|
|
+ help=_t("Location on local FS where the xslt files are stored for workflow import."),
|
|
|
private=True)
|
|
private=True)
|
|
|
|
|
|
|
|
LOCAL_SAMPLE_DIR = Config(
|
|
LOCAL_SAMPLE_DIR = Config(
|
|
|
key="local_data_dir",
|
|
key="local_data_dir",
|
|
|
default=os.path.join(os.path.dirname(__file__), "..", "..", "examples"),
|
|
default=os.path.join(os.path.dirname(__file__), "..", "..", "examples"),
|
|
|
- help=_("Location on local filesystem where the examples are stored."),
|
|
|
|
|
|
|
+ help=_t("Location on local filesystem where the examples are stored."),
|
|
|
private=True)
|
|
private=True)
|
|
|
|
|
|
|
|
LOCAL_SAMPLE_DATA_DIR = Config(
|
|
LOCAL_SAMPLE_DATA_DIR = Config(
|
|
|
key="sample_data_dir",
|
|
key="sample_data_dir",
|
|
|
default=paths.get_thirdparty_root("sample_data"),
|
|
default=paths.get_thirdparty_root("sample_data"),
|
|
|
- help=_("Location on local filesystem where the data for the examples is stored."),
|
|
|
|
|
|
|
+ help=_t("Location on local filesystem where the data for the examples is stored."),
|
|
|
private=True)
|
|
private=True)
|
|
|
|
|
|
|
|
REMOTE_SAMPLE_DIR = Config(
|
|
REMOTE_SAMPLE_DIR = Config(
|
|
|
key="remote_data_dir",
|
|
key="remote_data_dir",
|
|
|
default="/user/hue/oozie/workspaces",
|
|
default="/user/hue/oozie/workspaces",
|
|
|
- help=_("Location on HDFS where the Oozie workflows are stored."))
|
|
|
|
|
|
|
+ help=_t("Location on HDFS where the Oozie workflows are stored."))
|
|
|
|
|
|
|
|
SHARE_JOBS = Config(
|
|
SHARE_JOBS = Config(
|
|
|
key='share_jobs',
|
|
key='share_jobs',
|
|
|
default=True,
|
|
default=True,
|
|
|
type=coerce_bool,
|
|
type=coerce_bool,
|
|
|
- help=_('Share workflows and coordinators information with all users. If set to false, '
|
|
|
|
|
|
|
+ help=_t('Share workflows and coordinators information with all users. If set to false, '
|
|
|
'they will be visible only to the owner and administrators.'))
|
|
'they will be visible only to the owner and administrators.'))
|
|
|
|
|
|
|
|
OOZIE_JOBS_COUNT = Config(
|
|
OOZIE_JOBS_COUNT = Config(
|
|
|
key='oozie_jobs_count',
|
|
key='oozie_jobs_count',
|
|
|
default=100,
|
|
default=100,
|
|
|
type=int,
|
|
type=int,
|
|
|
- help=_('Maximum number of Oozie workflows or coodinators to retrieve in one API call.'))
|
|
|
|
|
|
|
+ help=_t('Maximum number of Oozie workflows or coodinators to retrieve in one API call.'))
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def config_validator():
|
|
|
|
|
+ res = []
|
|
|
|
|
+
|
|
|
|
|
+ status = get_oozie_status()
|
|
|
|
|
+
|
|
|
|
|
+ if 'NORMAL' not in status:
|
|
|
|
|
+ res.append((NICE_NAME, _("The app won't work without a running Oozie server")))
|
|
|
|
|
+
|
|
|
|
|
+ return res
|