[ https://issues.apache.org/jira/browse/METRON-795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15962892#comment-15962892 ]
ASF GitHub Bot commented on METRON-795: --------------------------------------- Github user dlyle65535 commented on a diff in the pull request: https://github.com/apache/incubator-metron/pull/500#discussion_r110661298 --- Diff: metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/rest_commands.py --- @@ -0,0 +1,71 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" + +from resource_management.core.logger import Logger +from resource_management.core.resources.system import Execute, File + +# Wrap major operations and functionality in this class +class RestCommands: + __params = None + + def __init__(self, params): + if params is None: + raise ValueError("params argument is required for initialization") + self.__params = params + + def setup_repo(self): + def local_repo(): + Logger.info("Setting up local repo") + Execute("yum -y install createrepo") + Execute("createrepo /localrepo") + Execute("chmod -R o-w+r /localrepo") + Execute("echo \"[METRON-${metron.version}]\n" + "name=Metron ${metron.version} packages\n" + "baseurl=file:///localrepo\n" + "gpgcheck=0\n" + "enabled=1\" > /etc/yum.repos.d/local.repo") + + def remote_repo(): + print('Using remote repo') + + yum_repo_types = { + 'local': local_repo, + 'remote': remote_repo + } + repo_type = self.__params.yum_repo_type + if repo_type in yum_repo_types: + yum_repo_types[repo_type]() + else: + raise ValueError("Unsupported repo type '{0}'".format(repo_type)) + --- End diff -- Could you merge with current master and remove the repo setup stuff? It's been deprecated in favor of repoinfo.xml. > Install Metron REST with Ambari MPack > ------------------------------------- > > Key: METRON-795 > URL: https://issues.apache.org/jira/browse/METRON-795 > Project: Metron > Issue Type: Improvement > Reporter: Ryan Merriman > Assignee: Ryan Merriman > > The REST application should be included in the Ambari MPack. This task > includes creating a RPM file for the metron-rest module and installing it via > Ambari MPack. -- This message was sent by Atlassian JIRA (v6.3.15#6346)