I prefer still allowing the user to delete the org but tell the user
what took place.
As a user, I find it very bothersome when systems block removal of
objects because 'that object is in use'. When you are trying to remove
things a system should always allow removal without forcing you to
determine which things need to be un-associated to complete the task at
hand.
Mike
On 06/09/2016 07:37 AM, Marek Hulán wrote:
Hello
I lean towards the second atm, if taxonomies are enabled we should not add
more actions leading to hosts being unassociated. I consider host without
organization in organization enabled instance as a bug. Long term I'd like to
see all hosts that are unassociated today being in fact associated to some
default org. Once we have that, we could set the host association to this new
default org on organization deletion.
Anyway if there are more votes for option 1, I as a user would like to know
that there were some hosts that were moved to the unasssociated hosts bucket.
At least a warning would be good.
--
Marek
On Wednesday 08 of June 2016 16:23:48 Tom McKay wrote:
To me, as a user, if I delete an org (or location) I'd simply want the
foreman resources to be unassociated from it. It may be the case, for
example, that a resource like a provisioning template is shared among
multiple orgs. A host is different, I know, in that it can belong to only
one org but I would still lean towards consistency by throwing it into the
bucket of unassociated hosts.
On Wed, Jun 8, 2016 at 3:05 PM, Partha Aji <[email protected]> wrote:
While working on one of the org deletion bugs (
http://projects.theforeman.org/issues/15336) I hit upon this
inconsistency in Foreman code base and would like suggestions on the
agreeable behavior.
So here is the user action
1) User creates an org
2) Assigns a host to that org
3) Deletes that org
There seem to be 2 different approaches taken in the foreman code
1)
https://github.com/theforeman/foreman/blob/develop/app/models/taxonomies/o
rganization.rb#L8 seems to indicate the intention to nullify the
organization-host
association if organization gets deleted. This tells me that its ok to
delete the org with hosts associated to it.
"has_many_hosts :dependent => :nullify"
2)
https://github.com/theforeman/foreman/blob/develop/test/functional/api/v2/
locations_controller_test.rb#L74 seems to indicate we do Not want to
delete orgs/locations if hosts are attached to it. "should NOT destroy
location if hosts use it" .
Looking at the commit dates for both, they were merged a mere month after
each other (jan - feb 2013). 2 came before 1 .
I prefer 1 over 2 .. Unassociate the Org from the Host if the org gets
deleted instead of blocking the delete. Whats your preferred approach.
Kindly let me know.
Partha
--
You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
For more options, visit https://groups.google.com/d/optout.
--
Mike McCune
mmccune AT redhat.com
Red Hat Engineering | Portland, OR
Systems Management | 650-254-4248
--
You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.