Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4653

filebucket fails when environment is specified

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 2.7.23
    • Fix Version/s: PUP 4.3.0
    • Component/s: None
    • Template:
    • Story Points:
      2
    • Sprint:
      Client 2015-07-22
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      This ticket was supposed to cleanup the client-side filebucket code so that in the future we could support HTTP(S) based file sources. After this change was made, we realized it fixed another bug where filebucket requests failed when an environment was specified (PUP-4954). So for release notes, puppet will correctly filebucket files when an environment is specified, such as when using agent specified environments.
      Show
      This ticket was supposed to cleanup the client-side filebucket code so that in the future we could support HTTP(S) based file sources. After this change was made, we realized it fixed another bug where filebucket requests failed when an environment was specified ( PUP-4954 ). So for release notes, puppet will correctly filebucket files when an environment is specified, such as when using agent specified environments.

      Description

      Since the 0.25 days, the filebucket client in the form of Puppet::FileBucket::Dipper has interfaces with the indirector by constructing URLs in the following fashion:

      @rest_path = "https://#{server}:#{port}/#{environment}/file_bucket_file/"
      # then
      dest_path = "#{@rest_path}#{file_bucket_file.name}/#{files_original_path}"
      

      The indirector breaks this down into its fields in Puppet::Indirector::Request#set_uri_key.

      env, indirector, @key = URI.unescape(uri.path.sub(/^\//, '')).split('/',3)
      @key ||= ''
      self.environment = env unless env == ''
      

      All of this is quite unecessary because

      1. the indirection implicitly follows from the indirected class
      2. the environment is not significant for filebucket interactions

      (As an aside, the API does not construct URLs like this anymore, either - the environment is a parameter and not a part of the URI path. This is not important here, though, because these URLs never hit the wire. They are only for the benefit of the Indirector::Request class.)

      A consequence of this construct is that new indirector uses with URLs in keys will be misinterpreted by the Request class.

      It would be beneficial to transform these internally used URLs into a form that

      1. confers only the necessary information to the indirector
      2. does not clash with other possible URLs

      Summary

      Although this sounds like a network change, it's not. It only changes how the client internally manages the filebucket request, but doesn't affect how the client sends the request on the wire. It also doesn't change file manifests, e.g. filebucket resources, etc.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  ffrank Felix Frank
                  QA Contact:
                  Eric Thompson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 0 minutes
                    0m
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 hour
                    1h