Merge "update sdnc-image"
authorDan Timoney <dtimoney@att.com>
Wed, 17 Feb 2021 14:22:42 +0000 (14:22 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 17 Feb 2021 14:22:42 +0000 (14:22 +0000)
Former-commit-id: 2e6aaffaaa0b39f3dadfcbe1e659199bc3c59df6

1  2 
installation/sdnc/src/main/scripts/installCerts.py

@@@ -2,7 -2,6 +2,7 @@@
  #  Copyright (C) 2019 Nordix Foundation.
  # ================================================================================
  #  extended by highstreet technologies GmbH (c) 2020
 +#  Copyright (c) 2021 Nokia Intellectual Property.
  # ================================================================================
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
@@@ -52,7 -51,6 +52,6 @@@ zipFileList = [
  
  username = os.environ['ODL_ADMIN_USERNAME']
  password = os.environ['ODL_ADMIN_PASSWORD']
- newpassword = os.environ.get('ODL_ADMIN_NEWPASSWORD')
  TIMEOUT=1000
  INTERVAL=30
  timePassed=0
@@@ -284,7 -282,6 +283,7 @@@ def jks_to_p12(file, password)
  def make_cert_chain(cert_chain, pattern):
      cert_list = []
      if cert_chain:
 +        cert_chain = cert_chain.decode('utf-8')
          matches = re.findall(pattern, cert_chain, re.DOTALL | re.MULTILINE)
          for cert in matches:
              cert_list.append(cert.strip())
@@@ -340,29 -337,6 +339,6 @@@ def process_jks_files(count)
          logging.error("UnExpected Error while processing JKS files at {0}, Caused by: {1}".format(Path, e))
          writeCertInstallStatus("NOTOK")
  
- def replaceAdminPassword(username, password, newpassword):
-     if newpassword is None:
-         logging.info('Not to replace password for user %s', username)
-     else:
-         logging.info('Replace password for user %s', username)
-         try:
-             jsondata = '{\"password\": \"{newpassword}\"}'.format(newpassword=newpassword)
-             url = '/auth/v1/users/{username}@sdn'.format(username=username)
-             loggin.info("Url %s data $s", url, jsondata)
-             conn = http.client.HTTPConnection("localhost",odl_port)
-             req = conn.request("PUT", url, jsondata, headers=headers)
-             res = conn.getresponse()
-             res.read()
-             httpStatus = res.status
-             if httpStatus == 200:
-                 logging.debug("New password provided successfully for user %s", username)
-             else:
-                 logging.debug("Password change was not possible. Problem code was: %d", httpStatus)
-         except:
-             logging.error("Cannot execute REST call to set password.")
-             writeCertInstallStatus("NOTOK")
  def readCertProperties():
      '''
      This function searches for manually copied zip file
      connected = makeHealthcheckCall(headers, timePassed)
      logging.info('Connected status: %s', connected)
      if connected:
-         replaceAdminPassword(username, password, newpassword)
          count = 0
          if os.path.isfile(Path + "/certs.properties"):
              with open(Path + "/certs.properties", "r") as f: