Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #9935] Implement support for restoring modified attributes #3285

Closed
icinga-migration opened this issue Aug 17, 2015 · 10 comments
Labels
area/api REST API enhancement New feature or request
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9935

Created by mfriedrich on 2015-08-17 12:52:43 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2015-09-23 11:30:03 +00:00)
Target Version: 2.4.0
Last Update: 2015-11-11 14:48:53 +00:00 (in Redmine)

Backport?: No
Include in Changelog: 0

Changesets

2015-09-18 13:01:44 +00:00 by mfriedrich 95bcbec

Implement support for restoring modified attributes

Also fix a glitch with ModifyAttribute and original_attributes
storage.

fixes #9935

2015-09-22 13:05:52 +00:00 by mfriedrich da7e78b

Fix persisting and restoring modified attributes for custom attribute indexers

refs #9935
fixes #9968

2015-09-23 11:29:30 +00:00 by mfriedrich 12cf90c

Fix persisting and restoring modified attributes for custom attribute indexers

fixes #9935
fixes #9968

Parent Task: #9081

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-08-17 12:53:04 +00:00

  • Parent Id set to 9081

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-09-04 12:04:56 +00:00

  • Assigned to set to mfriedrich

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-09-04 12:05:08 +00:00

  • Status changed from New to Assigned

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-09-18 12:51:48 +00:00

There's still something weird going on with modify attribute storing the original_attributes

h.modify_attribute("vars.os", { "bar"= "baz" })

    "vars": {
        "disks": {
            "disk": {

            },
            "disk /": {
                "disk_partitions": "/"
            }
        },
        "http_vhosts": {
            "http": {
                "http_uri": "/"
            }
        },
        "notification": {
            "mail": {
                "groups": [
                    "icingaadmins"
                ]
            }
        },
        "os": {
            "bar": "baz"
        }
    },

    "original_attributes": {
        "vars.os": {
            "disks": {
                "disk": {

                },
                "disk /": {
                    "disk_partitions": "/"
                }
            },
            "http_vhosts": {
                "http": {
                    "http_uri": "/"
                }
            },
            "notification": {
                "mail": {
                    "groups": [
                        "icingaadmins"
                    ]
                }
            },
            "os": "Linux"
        }
    },

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-09-18 13:01:32 +00:00

Similar to restoring attributes we should store the real dictionary (vars -> os -> ...) and not the string with indexers inside the original_attributes dictionary.

There's one problem with vars - we must always clone the entire vars dictionary and keep it inside the original_attributes dictionary, even if there's one key restored.

Restoring the attributes work fine.

h.restore_attribute("vars.os")

    "vars": {
        "disks": {
            "disk": {

            },
            "disk /": {
                "disk_partitions": "/"
            }
        },
        "http_vhosts": {
            "http": {
                "http_uri": "/"
            }
        },
        "notification": {
            "mail": {
                "groups": [
                    "icingaadmins"
                ]
            }
        },
        "os": "Linux"
    },

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-09-18 13:04:15 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 95bcbec.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-09-20 11:18:18 +00:00

  • Status changed from Resolved to Assigned
  • Done % changed from 100 to 90

We should discuss whether to store the entire indexer and value, or the resolved custom attribute as dictionary.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-09-23 11:30:04 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 90 to 100

Applied in changeset 12cf90c.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-09-24 20:10:32 +00:00

  • Backport? changed from TBD to No

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-11-11 14:48:53 +00:00

  • Include in Changelog changed from 1 to 0

@icinga-migration icinga-migration added enhancement New feature or request area/api REST API labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.4.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant