Git Product home page Git Product logo

katello-cvmanager's People

Contributors

calvinhartwell avatar chr15p avatar cliles avatar ericlake avatar evgeni avatar fabrizio2210 avatar fm0l avatar jberry avatar rocco83 avatar techsolo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

katello-cvmanager's Issues

useless parsing of tasks

Hi,

given the code, if the latest job is found with "no new packages" is found, then if checkrepos is "on" all of the tasks are parsed up to find out a task that match the channel that we need for.
We are here at the code

if @options[:checkrepos]

When one repository is found, further check are done

if tasker['input']['repository']['id'] == repo['id']

A deeper check start

def checktask(task, last_date)

When the task is from the past, the code is just skipping this task

puts_verbose "#{task['humanized']['output']} This past task will NOT trigger a Publish."

Wondering if in this section of code, if the task is from the paste, we can skip the remaining tasks.

if ( checktask(tasker, cv_last_published) )

Looking at the code , my understanding is that if a "past task" is found, since the tasks are sorted by ended_at, we can be sure that no other tasks will be found afterwards with packages that are missing.

Any comment?

cannot load such file -- apipie-bindings

Fresh install of cvmanager on 6.4.1

  • Did the git clone
  • Updated the username/password/uri
  • tried to run
[root@sat6 katello-cvmanager]# ./cvmanager clean
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- apipie-bindings (LoadError)
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from ./cvmanager:20:in `<main>'

output is not verbose enough

Using --checkrepos

Given the output

 'No new packages.' Found in last sync task, will search now for past sync tasks for packages not in the CV.
 repo Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server (id: 4) seems newer than CV RHEL7_Rolling_BaseRPM (id: 5), checking if sync contains new packages.
 'No new packages.' Found in last sync task, will search now for past sync tasks for packages not in the CV.
 repo Red_Hat_Enterprise_Linux_7_Server_-_Oracle_Java_RPMs_x86_64_7Server (id: 474) seems newer than CV RHEL7_Rolling_BaseRPM (id: 5), checking if sync contains new packages.
 'No new packages.' Found in last sync task, will search now for past sync tasks for packages not in the CV.
  No more tasks are found, Publish will be SKIPPED.

Is not clear enough which CV will be uploaded and which not.

I have given a really short look to the code, maybe
https://github.com/RedHatSatellite/katello-cvmanager/blob/master/cvmanager#L425
just need a put, as noop is already doing

Consider adding repository syncing

I think it'd also be useful to also add an option to sync repositories in satellite before promoting or publishing content views. Let me know if you think this functionality is a good candidate for this piece of software.

This is something I would be interested in working on in the near future.

ccv new version not published

hello, i try to publish & promote my ccv automatically. For CV´s it works. But for CCV´s no new version would be published. Where is my mistake?

`---
:settings:
:user: admin
:pass:
:uri: https://lnx-rbg40.int.osram-light.com
:timeout: 300
:org: 1
:lifecycle: 7
:keep: 5
:checkrepos: true
:promote_cvs: true

:ccv:
ccv-rhel7-base:
cv-rhel7: latest
cv-rhel7-tools: latest

:publish:

  • cv-rhel7-tools
  • cv-rhel7
  • ccv-rhel7-base

:promote:

  • ccv-rhel7-base`

Could not load data from https://localhost

Hi,
while trying publish a content view, I have the following message:

./cvmanager --wait publish

/usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:268:in `rescue in retrieve_apidoc': Could not load data from https://localhost (ApipieBindings::DocLoadingError)

is your server down?
was rake apipie:cache run when using apipie cache? (typical production settings)
from /usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:265:in retrieve_apidoc' from /usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:115:inapidoc'
from /usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/resource.rb:8:in initialize' from /usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:128:innew'
from /usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:128:in resource' from ./cvmanager:351:inpublish'
from ./cvmanager:517:in `'

Can someone help me ?

cat cvmanager.yaml


:settings:
:user: admin
:pass:XXXXX
:uri: https://localhost
:timeout: 300
:org: 1
:lifecycle: 2
:keep: 10
:ccv:
CCV_RHEL7_RHSC7_OPT7:
CV_OPT7: latest
CV_RHEL7: latest
CV_RHSC7: latest
:publish:

  • CV_OPT7
  • CV_RHEL7
  • CV_RHSC7

:promote:

  • CCV_RHEL7_RHSC7_OPT7

`Promote()` should use the version that the user defined in YAML, not just latest

I had a use case where we don't use composite content views, yet I wanted the promote command to use the content view version I defined. However, for some reason the promote command always uses the latest and does not check for the version the user defined in :cv: under YAML at all.

I suggest a solution in the code below, allowing the user specified version in YAML to be used, as well as latest. since I just hacked this together by combining aspects of the update() function, I will just paste the promote() function I made.

Also when the request in promote() gave a 400 bad request, as the exception was not handled, so I added a rescue statement, which now helpfully tells the command line user that they "Cannot promote environment out of sequence. Use force to bypass restriction.".

The YAML I use, where i have Library.yaml , dev.yaml (always kept up to date with Library), test.yaml, prod.yaml.

# prod.yaml
:settings:
  :user: admin
  :pass: YOURPASSWORD
  :uri: https://localhost
  :timeout: 300
  :org: 1              # always 1 
  :lifecycle: 6        # ID of the lifecycle, not always obvious
  :checkrepos: true    # check if the latest repo packages are already in the curre
nt content view
  :promote_cvs: true   # don't use composite content views for publishing
  :keep: 5
  :wait: false         # should cvmanager wait for tasks to finish, or run them in 
the background
  :sequential: 1       # run only one task at once
:cv:
  rhel7: 10.0   # I specifically want version 10 and not the latest 12
:publish:
  - rhel7
:promote:
  - rhel7

The promote() function:

def promote()
  tasks = []

  ccvs = []
  req = @api.resource(:content_views).call(:index, {:organization_id => @options[:org], :full_results => true})
  ccvs.concat(req['results'])
  while (req['results'].length == req['per_page'].to_i)
    req = @api.resource(:content_views).call(:index, {:organization_id => @options[:org], :full_results => true, :per_page => req['per_page'], :page => req['page'].to_i+1})
    ccvs.concat(req['results'])
  end

  ccvs.each do |ccv|
    next if not ccv['composite'] and not @options[:promote_cvs]
    next if not @yaml[:promote].include?(ccv['label']) and not @yaml[:promote].include?("all")

    puts "Inspecting #{ccv['label']}"

    # get the desired version for this component from the YAML
    # either the version for the component in this CCV is set
    # or it is set globally
    # never touch non-mentioned components
    if @yaml[:cv].is_a?(Hash) and @yaml[:cv].has_key?(ccv['label'])
      users_version = @yaml[:cv][ccv['label']]
      puts_verbose "  Desired version #{users_version} found in CV"

      # instead of hard-coding the versions, the user can also specify "latest"
      # figure out the latest content view version, choose it, unless there is none
      if users_version == 'latest'
        desired_version = ccv['versions'].sort_by { |v| v['version'].to_f }.reverse[0]
        next if ! desired_version
      else
        desired_version = ccv['versions'].select {|v| v["version"].to_f == users_version }[0]
        next if ! desired_version
      end
    else
      puts_verbose "  Desired version not found, skipping"
      next
    end

    if not desired_version['environment_ids'].include?(@options[:lifecycle])
      puts " Promoting version #{desired_version['version']} to lifecycle-environment #{@options[:lifecycle]}"
      if not @options[:noop]
        begin
          req = @api.resource(:content_view_versions).call(:promote, {:id => desired_version['id'], :environment_id => @options[:lifecycle], :force => @options[:force]})
          tasks << req['id']
          wait([req['id']]) if @options[:sequential]
        rescue RestClient::ExceptionWithResponse => e # catch exceptions with more helpful error content
          puts e.response
        end
      else
        puts " [noop] Promoting #{desired_version['version']} to lifecycle-environment #{@options[:lifecycle]}"
      end
    end
  end

  wait(tasks)
end

Huge memory usage with checkrepos

In case of --checkrepos may get to very high memory size can grow indefinitely.

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 11874 33.3 18.3 6247752 6024124 pts/11 Sl+ 18:18 33:05 ruby ./cvmanager --wait --checkrepos --config=cvmanager-xxx.yaml publish

At a brief look seems to me that https://github.com/RedHatSatellite/katello-cvmanager/blob/master/cvmanager#L334 is the problem.
What happens is that alll of tasks are extracted, and

Probably also https://bugzilla.redhat.com/show_bug.cgi?id=1362168#c20 can be part of the cause.

@cliles involving you as main contributor, i will give a try fixing the code.
PR should came shortly.

update doesn't update the ccv (composite content view) with the versions specified.

I've got the following YAML:

---
:settings:
  :user: admin
  :pass: changeme
  :uri: https://localhost
  :timeout: 300
  :org: 3
  :lifecycle: 9
  :keep: 3
  :promote_cvs: true
  :checkrepos: false
:ccv:
  ccv RHEL Server 7:
    cv EPEL 7: latest
    cv RHEL Server 7: latest
    cv RHSCL Server 7: latest
    cv Third Party Repositories for RHEL Server 7: latest
:publish:
  - cv EPEL 7
  - cv RHEL Server 7
  - cv RHSCL Server 7
  - cv Third Party Repositories for RHEL Server 7
:promote:
  - ccv RHEL Server 7

I first ran the publish command, which published all content views to the latest version. Then I ran the update command to update the composite content view so that all included content views would also be updated to the latest version:

# ./cvmanager update --config=cvmanager-rhel7.yaml

I get the following output:

Inspecting ccv RHEL Server 7
 Checking cv RHEL Server 7
 Checking cv RHSCL Server 7
 Checking cv EPEL 7
 Checking cv Third Party Repositories for RHEL Server 7

But when I check the versions of the included content views in the ccv in Satellite's WebUI, they're still at the same version as before running the update command.

Internal Server error 500 on promote

Satellite Version 6.5.1

Getting the following error when trying to promote to life cycle environment :

root@lsat1p:~/katello-cvmanager# ./cvmanager --config=rhel7_ccv.yaml --wait promote --to-lifecycle-environment 2
Inspecting rhel7_ccv
 Promoting latest version to lifecycle-environment 2
E, [2019-06-24T15:25:07.071573 #55474] ERROR -- : 500 Internal Server Error
Traceback (most recent call last):
        18: from ./cvmanager:545:in `<main>'
        17: from ./cvmanager:347:in `promote'
        16: from ./cvmanager:347:in `each'
        15: from ./cvmanager:359:in `block in promote'
        14: from /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/resource.rb:21:in `call'
        13: from /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:185:in `call'
        12: from /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:190:in `call_action'
        11: from /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:240:in `http_call'
        10: from /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:327:in `call_client'
         9: from /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/resource.rb:67:in `post'
         8: from /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:52:in `execute'
         7: from /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:145:in `execute'
         6: from /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:715:in `transmit'
         5: from /opt/rh/rh-ruby25/root/usr/share/ruby/net/http.rb:910:in `start'
         4: from /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:725:in `block in transmit'
         3: from /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:807:in `process_result'
         2: from /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:353:in `block in rest_client_call_block'
         1: from /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:103:in `return!'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:223:in `exception_with_response': 500 Internal Server Error (RestClient::InternalServerError)

Use the following yml configuration file :

---
:settings:
  :user: admin
  :pass: redhat123
  :uri: https://lsat1p.fenetwork.com
  :timeout: 300
  :org: 1
  :keep: 5
  :verify_ssl: false
  :lifecycle: 2
:ccv:
  rhel7_ccv:
    rhel7_cv: latest
    fecs7_cv: latest
    epel7_cv: latest
:publish:
  - rhel7_cv
  - fecs7_cv
  - epel7_cv
:promote:
  - rhel7_ccv

What do we do to fix this?

[RFE] add force yum metadata regeneration

Can you add the ability to emulate the "--force-yum-metadata-regeneration true" switch ?
E.G. with hammer I could use

hammer content-view publish --name CV-RHEL --organization-id 3 --force-yum-metadata-regeneration true

Thanks

add note on Sat 6.3 to readme?

Sat 6.3 offers the ability to select 'Latest' under the CV selection of a CCV.

Can you please add a section to README.md on how this affects cvmanager?

CV Last Published date doesn't correspond with actual last published date

{
   "content_host_count":0,
   "composite":false,
   "repository_ids":[
      7682,
      7681
   ],
   "component_ids":[

   ],
   "default":false,
   "next_version":20,
   "id":40,
   "name":"Satellite_Tools_5_Repos",
   "label":"Satellite_Tools_5_Repos",
   "description":null,
   "organization":{
      "name":"My Company",
      "label":"My Compant",
      "id":3
   },
   "created_at":"2015-08-19 15:33:24 UTC",
   "updated_at":"2017-01-10 22:31:50 UTC",
   "environments":[
      {
         "id":2,
         "name":"Library",
         "label":"Library",
         "permissions":{
            "readable":true
         }
      }
   ],
   "repositories":[
      {
         "id":7682,
         "name":"Red Hat Satellite Tools 6.2 for RHEL 5 Server RPMs x86_64",
         "label":"Red_Hat_Satellite_Tools_6_2_for_RHEL_5_Server_RPMs_x86_64",
         "content_type":"yum"
      },
      {
         "id":7681,
         "name":"Red Hat Satellite Tools 6.2 for RHEL 5 Server RPMs i386",
         "label":"Red_Hat_Satellite_Tools_6_2_for_RHEL_5_Server_RPMs_i386",
         "content_type":"yum"
      }
   ],
   "puppet_modules":[

   ],
   "versions":[
      {
         "id":1871,
         "version":"18.0",
         "published":"2017-01-09 16:38:41 UTC",
         "environment_ids":[

         ]
      },
      {
         "id":1928,
         "version":"19.0",
         "published":"2017-01-10 22:31:50 UTC",
         "environment_ids":[
            2
         ]
      },
      {
         "id":1735,
         "version":"16.0",
         "published":"2016-11-15 15:22:39 UTC",
         "environment_ids":[

         ]
      },
      {
         "id":1491,
         "version":"12.0",
         "published":"2016-08-24 18:04:26 UTC",
         "environment_ids":[

         ]
      },
      {
         "id":1494,
         "version":"13.0",
         "published":"2016-08-24 18:19:00 UTC",
         "environment_ids":[

         ]
      },
      {
         "id":1666,
         "version":"15.0",
         "published":"2016-10-18 16:14:47 UTC",
         "environment_ids":[

         ]
      },
      {
         "id":1745,
         "version":"17.0",
         "published":"2016-11-15 16:52:09 UTC",
         "environment_ids":[

         ]
      },
      {
         "id":1543,
         "version":"14.0",
         "published":"2016-09-20 02:29:20 UTC",
         "environment_ids":[

         ]
      }
   ],
   "components":[

   ],
   "activation_keys":[

   ],
   "last_published":"2016-09-20 02:29:20 UTC",
   "permissions":{
      "view_content_views":true,
      "edit_content_views":true,
      "destroy_content_views":true,
      "publish_content_views":true,
      "promote_or_remove_content_views":true
   }
}

sequential 4 seems to delay log output

the promote action seems to output it's logs delayed when using :sequential: 4 in cvmanager.yaml

steps to reproduce:

  1. use a cvmanager (git pull-ed 2017-09-12)

  2. set :sequential: 4 in cvmanager.yaml

  3. have some (about 18 in this case) CCV to promote defined in cvmanager.yaml

  4. have time ./cvmanager --wait promote --to-lifecycle-environment 30 in a wrapper script (cvauto.sh also calls time ./cvmanager --wait publish and time ./cvmanager --wait update plus some other non-cvmanager commands)

  5. /root/katello-cvmanager/cvauto.sh | tee /root/katello-cvmanager/cvauto_$(date +"%Y-%m-%d_%H-%M-%S").log

  6. try to follow a Satellite task in the webUI by gettng it's ID from the cvmanager output

actual result:

Tasks get scheduled and executed in batches of 4 as intended.
But I can follow Synchronize repository … Tasks in the Satellite webUI way before they show up in the shell. Some may finish before I see them in the cvmanager output
e.g. 2df778d3-e553-4c36-8bc1-befd0a36bac8 ran as follows:

Started at: 2017-09-12 18:56:40 UTC
Ended at: 2017-09-12 19:11:04 UTC 

but in the tee I saw it only some time after 19:16 UTC

What I get is long period of silence and when there is output it's about many tasks followed by another long (double digit minutes) period of silence.

expected result:

seeing output like the following around the time the tasks are queued, not many minutes later.

Inspecting ccv-demo-rhel6-qpid
 Promoting latest version to lifecycle-environment 30
waiting 10 for pending tasks: ["b552cc77-173b-4ea9-b4d2-27d882dd42bf"]
waiting 20 for pending tasks: ["b552cc77-173b-4ea9-b4d2-27d882dd42bf"]

addition info:

  • Thanks for adding the sequential option, I find it extremely useful!
  • Other output from the script show up in the tee fluid as expected.
  • To me this delayed output does not matter much, normally the wrapper script runs at night from cron as /root/katello-cvmanager/cvauto.sh > /root/katello-cvmanager/cvauto_$(date +"%Y-%m-%d_%H-%M-%S").log 2>&1 and the logs are looked at in the morning, but I figured you'd want to know.
  • I see the same delayed log chunks on the clean action. Did not notice on other actions (e.g. update) yet, but then again I did not attentively follow the other actions called by the wrapper script.
  • the clean action triggered, amongst others, "5c70e2f1-8443-4a30-8191-9b72443952f4" which ran from 19:23:32 UTC to 19:23:36 UTC yet shell output about the task was only some time after 19:27, with many other clean tasks in the same log burst (that had mostly also already finished).
  • the terminal I ran this in remains perfectly usable, so it's not my connection. ;-) Maybe I'm just using tee wrong.

Publish not possible if local repository is inside CV

Our base OS RHEL7 CV consists of several RedHat repos and also of one repo for thirdparty content.
The one repo from our thirdparty product is a local filerepo with only one RPM inside.
When trying to publish a new of the base OS CV cvmanager checks for new Versions and then breaks with:

./cvmanager:353:in block (2 levels) in publish': undefined method has_key?' for nil:NilClass (NoMethodError)
from ./cvmanager:349:in each' from ./cvmanager:349:in block in publish'
from ./cvmanager:325:in each' from ./cvmanager:325:in publish'
from ./cvmanager:476:in `

'
When i remove the one local repo publishing works like expected.
I suppose it breaks because the sync state and date of the local repo is always set and displayed as N/A.
Is there any way to skip the check for new versions so that this missing sync state/date is ignored ?

Does it honor a different config file at all?

I've created a few .yaml files, some with a complex content view set up and some with a very simple set up. No matter what option I provide on the command line -c or --config=somefile.yaml, it doesn't seem to pick that up.

Besides that, how can I get some more verbose feedback?

CVs need one version published

if a CV is asked to be updated, but no version of it has yet been published, there's a traceback.

It would be nice if either of these happened instead

  • katello-cvmanager handled this case and just creates version 1.0
  • there was an explicit error message along the lines of "no version yet, please publish one"

Shout if you want a paste of the traceback and I'll post it from my test Sat (ran into it on a customer machine today, but can't really paste from there)

Running cvmanager crashes with "Forbidden" error

I'm trying to use the latest version of katello-cvmanager along with Red Hat Satellite 6.2.8 on EL7 (satellite-6.2.8-4.0.el7sat). When starting the utility I'm receiving the following error:

# ./cvmanager -n --verbose update
/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!': 403 Forbidden (RestClient::Forbidden)
        from /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
        from /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
        from /usr/share/ruby/net/http.rb:852:in `start'
        from /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
        from /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
        from /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
        from /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:51:in `get'
        from /usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:286:in `call_client'
        from /usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:217:in `http_call'
        from /usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/api.rb:162:in `call'
        from /usr/share/gems/gems/apipie-bindings-0.0.14/lib/apipie_bindings/resource.rb:14:in `call'
        from ./cvmanager:208:in `update'
        from ./cvmanager:481:in `<main>'

In the Foreman production log I see the following entries when running the utility:

2017-04-07 13:51:30 [app] [I] Started GET "/katello/api/organizations/1/content_views?full_results=true" for ::1 at 2017-04-07 13:51:30 +0200
2017-04-07 13:51:30 [app] [I] Processing by Katello::Api::V2::ContentViewsController#index as JSON
2017-04-07 13:51:30 [app] [I]   Parameters: {"full_results"=>"true", "api_version"=>"v2", "organization_id"=>"1", "content_view"=>{}}
2017-04-07 13:51:30 [app] [I] Authorized user svc-cvmanager(Cedric CVManager)
2017-04-07 13:51:30 [app] [I]   Rendered api/v2/errors/access_denied.json.rabl within api/v2/layouts/error_layout (0.6ms)
2017-04-07 13:51:30 [app] [I] Filter chain halted as :authorize rendered or redirected
2017-04-07 13:51:30 [app] [I] Completed 403 Forbidden in 26ms (Views: 1.5ms | ActiveRecord: 4.6ms)

I created a dedicated service user for katello-cvmanager within Red Hat Satellite - for testing purposes (to ensure that this error is not forced by missing privileges) I assigned the administrator role to this user. I also ensured that SELinux is not forcing any errors.

Necessary roles for a dedicated cvmanager user

This are the Permissions that I needed (grouped per Resource) to be able to publish, promote and clean content views using a dedicated restricted user:

Content Views

  • view_content_views, publish_content_views, promote_or_remove_content_views, destroy_content_views

Lifecycle Environment

  • promote_or_remove_content_views_to_environments

Product and Repositories

  • view_products

When two cv's get updated in one ccv, it doesn't update properly

If you have a composite view, and two of the member content views change, it doesn't properly update the CCV:

Checking Repo1
Updating from 7.0 to 8.0
Old components: [1132, 1134, 979, 1260]
New components: [1132, 979, 1260, 1300]
Checking Repo2
Updating from 16.0 to 17.0
Old components: [1132, 1134, 979, 1260]
New components: [1132, 1134, 979, 1289]

You'll notice the "Old components" on the Repo2 update still lists the original components, not the new old components since Repo1 changed first

cvmanager not working with Sat 6.5.2?

Just upgraded from 6.2 to 6.5 and testing out various cvmanager commands.

using the same yaml file that I used to use on 6.2

---
:settings:
  :user: user
  :pass: userpass
  :uri: https://localhost
  :timeout: 300
  :org: 1
  :lifecycle: 58
  :keep: 3
:cv:
  rhel-7-server: latest
:promote:
  - rhel-7-server
:publish:
  - rhel-7-server

./cvmanager --config=rhel-7-server.yaml --wait publish
Inspecting rhel-7-server as listed in CSV

and nothing happens... same for update and promote.

no new version created or promoted

Encoding::InvalidByteSequenceError

Hi Team,
I'm not a ruby program and I feel cvmanager will solve most of my requirement.
I'm sure this issue has reported in GitHub for different scenarios. I'm trying to use cvmanager for Redhat satellite 6 and Foreman. I'm getting the below error while running the script.

Can you please help me to fix the issue.

ruby cvmanager --wait publish --verbose
/usr/share/gems/gems/json-1.7.7/lib/json/common.rb:155:in encode': "\xE2" on US-ASCII (Encoding::InvalidByteSequenceError) from /usr/share/gems/gems/json-1.7.7/lib/json/common.rb:155:in initialize'
from /usr/share/gems/gems/json-1.7.7/lib/json/common.rb:155:in new' from /usr/share/gems/gems/json-1.7.7/lib/json/common.rb:155:in parse'
from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:129:in load_apidoc' from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:138:in apidoc'
from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/resource.rb:8:in initialize' from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:151:in new'
from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:151:in resource' from cvmanager:375:in publish'
from cvmanager:541:in `

'

provide a way to update repository before publish

The current behavior of cvmanager is to not take care of sw repository.
The truth is that we should have hopefully a repo sync just before the CV publish

Also, sometimes the repo sync may be not enough (see, any new added repo has to be added to sync plan).

A correct approach would be allowed to run a synchronization against:

  • All of the repo belonging to the organization (simple one)
  • All of the repo belongin to the CV in subject of the publish

The second one is much effective, but it is probably more challanging.

Updating CCV terminates with error:

./cvmanager --wait update -n
Inspecting ALL CentOS6 Updates
./cvmanager:223:in `initialize': no implicit conversion from nil to integer (TypeError)
        from ./cvmanager:223:in `new'
        from ./cvmanager:223:in `block in update'
        from ./cvmanager:215:in `each'
        from ./cvmanager:215:in `update'
        from ./cvmanager:481:in `<main>'

my config file:

---
:settings:
  :user: admin
  :pass: changeme
  :uri: https://localhost
  :timeout: 300
  :org: 3
  :lifecycle: 5
  :keep: 2
:ccv:
  ALL CentOS7 Updates:
    Bareos Updates EL7: latest
    OS updates EL7: latest
    Puppet Updates EL7: latest
    Zabbix Updates EL7: latest
    Katello Client Updates EL7: latest
  ALL CentOS6 Updates:
    Bareos Updates EL6: latest
    OS updates EL6: latest
    Puppet Updates EL6: latest
    Zabbix Updates EL6: latest
    Katello Client Updates EL6: latest
:publish:
  - Bareos Updates EL7
  - OS updates EL7
  - Puppet Updates EL7
  - Zabbix Updates EL7
  - Katello Client Updates EL7
  - Bareos Updates EL6
  - OS updates EL6
  - Puppet Updates EL6
  - Zabbix Updates EL6
  - Katello Client Updates EL6
  - OS Updates Fedora 25
:promote:
  - OS Updates Fedora 25
  - ALL CentOS7 Updates 
  - ALL CentOS6 Updates 

[RFE] serialised operation

On my small Satellite (VM, 18GB RAM, storage on SATA), the parallel operations (esp publish) weigh in heavy.

It would be nice if there was a 'serialise: True|False' flag that would publish, update and promote the (C)CVs in a serial fashion.

Repo last_sync is nil, crashes cvmanager

if repo.has_key?('last_sync') and repo['last_sync'].has_key?('ended_at') and repo['last_sync']['ended_at']

If repo['last_sync'] is nil, that code fails. The key itself exists, but it's nil. Need to add a check if last_sync is nil before doing the last_sync.has_key?

issue with publish

Hello, just found this project yesterday and was trying to promote and publish a CV and i am keep getting

[VERBOSE] Found past task that matches repo id: 18
[VERBOSE] 2017-04-11 02:42:38 UTC is before 2017-07-24 20:08:10 UTC, will NOT trigger a Publish.
[VERBOSE] Inspecing sync tasks to #10
[VERBOSE] Inspecing sync tasks to #10
[VERBOSE] Found past task that matches repo id: 18
[VERBOSE] 2017-04-11 00:27:15 UTC is before 2017-07-24 20:08:10 UTC, will NOT trigger a Publish.
[VERBOSE] Inspecing sync tasks to #10

and its keep going on and on... is there something that needs to be cleared out before this will work ?


:settings:
:user: admin
:pass: something
:uri: https://localhost
:timeout: 300
:org: 1
:lifecycle: 25
:keep: 1
:promote_cvs: true
:checkrepos: true
:cv:
rhel-7-server-x86_64: latest
:promote:

  • rhel-7-server-x86_64
    :publish:
  • rhel-7-server-x86_64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.