Uploaded image for project: 'Cloudify'
  1. CFY-6934

`cfy profiles use` breaks without --rest-port

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Unprioritized
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.1
    • Labels:
      None
    • Sprint:
      Cloudify 4.1 Sprint 2

      Description

      Repro:
      1. Create 2 managers
      2. Prepare CLI profiles for each of them:
      2.1. cfy profiles use manager.ip.1 -u user_1 -p password_1 -t tenant_1
      2.2. cfy profiles use manager.ip.2 -u user_2 -p password_2 -t tenant_2
      2.3. The credentials for each manager should be different (use cfy users set-password if needed)
      3. Now one of the profiles is activated (eg. manager.ip.2)
      4. Try to activate the other profile, WITHOUT passing credentials or --rest-port on the cli: cfy profiles use manager.ip.1

      Expected behaviour:
      Credentials that are stored in the previously-prepared profile are used, and the profile is activated

      What happens instead:
      an error is thrown: 401: User unauthorized: Authentication failed for <User username=`admin`>.

      This is because the CLI tries to contact manager B to see if it's secured or not (ie. if it should use HTTPS or HTTP), and that request uses the currently active profile, BEFORE profile B has been activated, so it uses profile A - but the ip has been provided explicitly on the command line, so it tries to connect to ip B using A's credentials

        Attachments

          Activity

            People

            • Assignee:
              lukasz.maksymczuk Łukasz Maksymczuk
              Reporter:
              lukasz.maksymczuk Łukasz Maksymczuk
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: