metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cestella <>
Subject [GitHub] metron pull request #888: METRON-1389: Zeppelin notebook import does not wor...
Date Fri, 12 Jan 2018 14:47:07 GMT
Github user cestella commented on a diff in the pull request:
    --- Diff: metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/
    @@ -150,12 +151,36 @@ def zeppelin_notebook_import(self, env):
   'Searching for Zeppelin Notebooks in {metron_config_zeppelin_path}'))
    +        # With Ambari 2.5+, Zeppelin server is enabled to work with Shiro authentication,
which requires user/password
    +        # for authentication (see
for details).
    +        ses = requests.session()
    +        # Check if authentication is enabled on the Zeppelin server
    +        try:
    +            conn = ses.get(ambari_format('http://{zeppelin_server_url}/api/login'))
    +            # Establish connection if authentication is enabled
    +            try:
    +                # The following credentials are created at install time by Ambari at
    +                # when Shiro auth is enabled on the Zeppelin server
    +                zeppelin_payload = {'userName': 'admin', 'password' : 'admin'}
    --- End diff --
    so, I wonder if we should add a configuration parameter for zeppelin user/pass.  If people
change the default user/pass of zeppelin, this won't work, I think.  The other option is whether
or not there is an existing config in ambari where this is held (maybe not though).  Beyond
that, we could always parse the shiro.ini (even as simple as a little python snippet like:
    with open('/etc/zeppelin/conf/shiro.ini', 'r') as f:
      seen_users = False
      for line in f:
        if '[users]' in line:
          seen_users = True
        if seen_users and 'admin = ' in line:
          tokens = line.strip().split(',')
          username = tokens[0].split(' ')[-1].strip()
          password = tokens[1].strip()
          print "username: {}, password: {}".format(username, password)
    I am just a bit concerned at having this go in as it is given this assumption, but I could
probably be talked into it by another committer.


View raw message