Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 10 01:00
    Travis ManageIQ/manageiq-graphql (master) fixed (1590)
  • Feb 09 00:59
    Travis ManageIQ/manageiq-graphql (master) broken (1587)
  • Dec 10 2019 16:54
    Travis ManageIQ/manageiq-graphql (ivanchuk-2) passed (1405)
  • Dec 10 2019 16:36

    simaishi on ivanchuk-2

    (compare)

  • Nov 21 2019 19:10
    mfeifer labeled #32
  • Nov 21 2019 19:10
    mfeifer unlabeled #32
  • Nov 21 2019 19:10
    mfeifer labeled #32
  • Nov 08 2019 22:05

    Fryguy on master

    Optionally symlink spec/managei… Merge pull request #84 from agr… (compare)

  • Nov 08 2019 22:05
    Fryguy closed #84
  • Nov 08 2019 22:05
    Fryguy labeled #84
  • Nov 08 2019 22:05
    Fryguy milestoned #84
  • Nov 08 2019 22:05
    Fryguy assigned #84
  • Nov 08 2019 13:51
    miq-bot commented #84
  • Nov 08 2019 13:50
    agrare synchronize #84
  • Nov 08 2019 13:39
    agrare edited #84
  • Nov 08 2019 13:37
  • Nov 08 2019 13:28
    agrare opened #84
  • Nov 06 2019 17:47
    simaishi assigned #83
  • Nov 06 2019 17:47
    simaishi milestoned #83
  • Nov 06 2019 17:47
    simaishi labeled #83
Martin Hradil
@himdel
oh ... which problem are you solving ?
Nick LaMuro
@NickLaMuro

basically, it was two pronged:

In app/models/manageiq/providers/embedded_ansible/seeding.rb when you first enable the role, it will create a default credential, but only assign it the name attribute. This was mostly okay since we were using the relation to fill in the rest.

But with the native_ref call, this would bomb when trying to type cast a nil to an integer. manager_ref was something we got from a refresh when using ansible_tower

Martin Hradil
@himdel
aah, but it still waits for a task
Nick LaMuro
@NickLaMuro
there is a "task" we create for this, but it is mostly ceremony for the UI now, since there is zero refresh is needed
but it was bombing prior to that (at least for me) because of the above
Martin Hradil
@himdel
ok, I'll run simulate_queue_worker and look at the new last one?
Nick LaMuro
@NickLaMuro
the fix (I think) is just to make sure we put in a stub manager_ref for the sake of things that still use it when seeding
that should be right, though I am suprised you don't have to re-run that API call
Martin Hradil
@himdel
Heheh, [----] I, [2019-06-19T18:09:32.654219 #19301:2b2882198e64] INFO -- : Completed 400 Bad Request in 178176ms (Views: 0.1ms | ActiveRecord: 159.6ms)
{"error":{"kind":"bad_request","message":"Could not create Service Template - undefined method '[]' for nil:NilClass","klass":"Api::BadRequestError"}}
Nick LaMuro
@NickLaMuro
this is where I am wondering if you had carried over credentials from a previous database
Martin Hradil
@himdel
[----] I, [2019-06-19T18:09:30.509561 #2152:2b1964ddc5b8]  INFO -- : MIQ(MiqQueue#deliver) Message id: [123135691], Delivering...
[----] I, [2019-06-19T18:09:30.590707 #2152:2b1964ddc5b8]  INFO -- : MIQ(MiqTask#update_status) Task: [366200] [Active] [Ok] [Task starting]
[----] I, [2019-06-19T18:09:32.337412 #2152:2b1964ddc5b8]  INFO -- : MIQ(MiqQueue#delivered) Message id: [123135691], State: [ok], Delivered in [1.827865993] seconds
[----] I, [2019-06-19T18:09:32.338922 #2152:2b1964ddc5b8]  INFO -- : MIQ(MiqQueue#m_callback) Message id: [123135691], Invoking Callback with args: ["Finished", "ok", "Message delivered successfully", "#<ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScript id: 468, manager_id: 2, manager_ref: nil, name: \"miq_ff_provision\", description: \"fff\", variables: {\"project\"=>\"21\", \"inventory\"=>2, \"become_enabled\"=>false, \"verbosity\"=>\"0\", \"ask_variables_on_launch\"=>true, \"ask_limit_on_launch\"=>true, \"ask_inventory_on_launch\"=>true, \"ask_credential_on_launch\"=>true, \"extra_vars\"=>\"{}\", \"credential\"=>2}, created_at: \"2019-06-19 18:09:32\", updated_at: \"2019-06-19 18:09:32\", survey_s..."]
[----] I, [2019-06-19T18:09:32.435265 #2152:2b1964ddc5b8]  INFO -- : MIQ(MiqTask#update_status) Task: [366200] [Finished] [Ok] [Task completed successfully]
Oh that could defiinitely be true, is there a purge button?
oh, right, purge the ones where the provider doesn't exist :)
Nick LaMuro
@NickLaMuro
not that I can tell it seems, or at least we don't have it set up in the relations to do it
Martin Hradil
@himdel
huh, should manager_id and manager_ref match at all?
Nick LaMuro
@NickLaMuro
manager_ref was supposed to be an idea id on the ansible_tower side (referencing a record in the ansible tower database)
now it doesn't make sense for EmbeddedAnsible since we are just using ansible_runner and own everything ourselves in our DB
Martin Hradil
@himdel
> ManageIQ::Providers::EmbeddedAutomationManager.first.authentications.all.map { |a| a.manager_ref }
=> ["2", "5", "8", "7", "9", "10", "3", "4", "2"]
> ManageIQ::Providers::EmbeddedAutomationManager.first.authentications.all.map { |a| a.manager_id }
=> [2, 2, 2, 2, 2, 2, 2, 2, 2]
oh, ok.. in that case, the failure on my side could just be that I'm not running any ansible?
Nick LaMuro
@NickLaMuro
it is more we haven't really written the migrations to migrate the data completely, since it is a work in progress
Martin Hradil
@himdel
(And it still sounds like the API should not be trying to wait..)
aah, makes sense :)
Nick LaMuro
@NickLaMuro

yeah, that one was a bit weird

I think previously it was just waiting for a task to be started, and then it creates the service_template on ansible_tower end in that task

and I think it also had to wait to get a reference ID for that job in tower before it could return sucessfully
Martin Hradil
@himdel
that sounds about right... the UI is hardcoded to flash Add of Repository "%s" was successfully initiated on success, that fits the idea
Martin Hradil
@himdel
wait no... I'm looking at entirely the wrong file
Catalog Item %s was saved
idk
Nick LaMuro
@NickLaMuro
yeah, me too, and I am "working" on this stuff as well :sweat_smile:
Nick LaMuro
@NickLaMuro
okay, I think this will fix the bug for new instance of embedded ansible going forward: ManageIQ/manageiq#18897
Daniel Berger
@djberg96
d-m-u
@d-m-u
yeah, yeah, yeah, i know, it's failing, and it's my fault, i'm working on it
Alexander Zagaynov
@AlexanderZagaynov
who can merge that? ManageIQ/manageiq-api#631
JVue
@JVue
Hello, having trouble getting the the user management action “set_current_group” (/api/users/:id) working - i’ve tried using the group description / href but I keep getting the return with msg: "Cannot set current_group - Must specify a current_group” (I’m looking to programmatically change the current group someone is assigned to via api - let me know if this function was not intended to do this) Thanks
{
    "error": {
        "kind": "bad_request",
        "message": "Cannot set current_group - Must specify a current_group",
        "klass": "Api::BadRequestError"
    }
}
Martin Hradil
@himdel

@JVue what exactly are you sending?

But, if it helps, here's how the Service UI is using it: https://github.com/ManageIQ/manageiq-ui-service/blob/master/client/app/core/navigation/navigation-controller.js#L230

(the use case this is for is a user changing their own current_group to one of their miq_groups. Not sure changing it for other users is supposed to work, but in theory, why not.)
JVue
@JVue
@himdel I’m posting exactly what the doco says:
{
  "action" : "set_current_group",
  "resource" : {
    "group" : { "description" : "EvmGroup-auditor" }
  }
}
use case - when a user consumes our internal API that talks to MIQ, they don’t have to worry about logging into miq first and changing their group to one that has the proper role first… our API will automatically change their current group to the proper one then revert back to their last group when done
(for permissions, we’ll use admin creds to set their group)
i think i tried changing my own group under my own creds and got the same message as above earlier
JVue
@JVue
yeah just tried again and got the same response as above… just trying to switch between groups that i’m a part of
{
  "action" : "set_current_group",
  "resource" : {
    "group" : { "description" : "EvmGroup-auditor” } <——— insert group name you want to switch to
  }
}
Martin Hradil
@himdel
@JVue What SUI is sending is slightly different...
        'action': 'set_current_group',
        'current_group': {'id': group.id}
which would probably explain that "Cannot set current_group - Must specify a current_group"
(maybe sending description isntead of id works too, I think the problem is with .resource.group vs just .current_group)
JVue
@JVue
@himdel let me give that a shot…
JVue
@JVue
Awesome! it works.. ( might want to update the doco to call out group ID only (as opposed to description or href) ) thanks much @himdel ! (http://manageiq.org/docs/reference/latest/api/reference/users)