|
@@ -15,24 +15,50 @@
|
|
|
# See the License for the specific language governing permissions and
|
|
# See the License for the specific language governing permissions and
|
|
|
# limitations under the License.
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
+from django.utils.translation import ugettext as _, ugettext_lazy as _t
|
|
|
|
|
|
|
|
-from desktop.lib.conf import Config, coerce_bool
|
|
|
|
|
-from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
|
|
+from desktop.lib.conf import Config, coerce_bool, validate_path
|
|
|
|
|
|
|
|
|
|
|
|
|
OOZIE_URL = Config(
|
|
OOZIE_URL = Config(
|
|
|
key='oozie_url',
|
|
key='oozie_url',
|
|
|
- help=_('URL to Oozie server. This is required for job submission.'),
|
|
|
|
|
|
|
+ help=_t('URL to Oozie server. This is required for job submission.'),
|
|
|
default='http://localhost:11000/oozie',
|
|
default='http://localhost:11000/oozie',
|
|
|
type=str)
|
|
type=str)
|
|
|
|
|
|
|
|
SECURITY_ENABLED = Config(
|
|
SECURITY_ENABLED = Config(
|
|
|
key="security_enabled",
|
|
key="security_enabled",
|
|
|
- help=_("Whether Oozie requires client to do perform Kerberos authentication"),
|
|
|
|
|
|
|
+ help=_t("Whether Oozie requires client to perform Kerberos authentication"),
|
|
|
default=False,
|
|
default=False,
|
|
|
type=coerce_bool)
|
|
type=coerce_bool)
|
|
|
|
|
|
|
|
REMOTE_DEPLOYMENT_DIR = Config(
|
|
REMOTE_DEPLOYMENT_DIR = Config(
|
|
|
key="remote_deployement_dir",
|
|
key="remote_deployement_dir",
|
|
|
default="/user/hue/oozie/deployments",
|
|
default="/user/hue/oozie/deployments",
|
|
|
- help=_("Location on HDFS where the workflows/coordinator are deployed when submitted by a non owner."))
|
|
|
|
|
|
|
+ help=_t("Location on HDFS where the workflows/coordinator are deployed when submitted by a non owner."))
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def config_validator():
|
|
|
|
|
+ """
|
|
|
|
|
+ config_validator() -> [ (config_variable, error_message) ]
|
|
|
|
|
+
|
|
|
|
|
+ Called by core check_config() view.
|
|
|
|
|
+ """
|
|
|
|
|
+ from hadoop.cluster import get_all_hdfs
|
|
|
|
|
+
|
|
|
|
|
+ res = []
|
|
|
|
|
+
|
|
|
|
|
+ class ConfigMock:
|
|
|
|
|
+ def __init__(self, value): self.value = value
|
|
|
|
|
+ def get(self): return self.value
|
|
|
|
|
+ def get_fully_qualifying_key(self): return self.value
|
|
|
|
|
+
|
|
|
|
|
+ for cluster in get_all_hdfs().values():
|
|
|
|
|
+ res.extend(validate_path(REMOTE_DEPLOYMENT_DIR, is_dir=True, fs=cluster,
|
|
|
|
|
+ message=_('The deployment directory of Oozie workflows does not exist. '
|
|
|
|
|
+ 'Please run "Setup App" on the Oozie workflow page.')))
|
|
|
|
|
+ res.extend(validate_path(ConfigMock('/user/oozie/share/lib'), is_dir=True, fs=cluster,
|
|
|
|
|
+ message=_('Oozie Share Lib not installed in default location.')))
|
|
|
|
|
+
|
|
|
|
|
+ return res
|