Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OSM Packages
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
17
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vnf-onboarding
OSM Packages
Merge requests
!190
Fix bug 1987
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix bug 1987
fix-bug-1987
into
master
Overview
0
Commits
1
Pipelines
18
Changes
59
Merged
garciadav
requested to merge
fix-bug-1987
into
master
2 years ago
Overview
0
Commits
1
Pipelines
18
Changes
22
Expand
0
0
Merge request reports
Compare
version 8
version 8
943215c7
2 years ago
version 7
649fc52b
2 years ago
version 6
10c5fec6
2 years ago
version 5
29d261eb
2 years ago
version 4
4d420a7d
2 years ago
version 3
0eed5e2c
2 years ago
version 2
65bdbe47
2 years ago
version 1
dd0aeb5d
2 years ago
master (base)
and
latest version
latest version
d433b37c
1 commit,
2 years ago
version 8
943215c7
1 commit,
2 years ago
version 7
649fc52b
1 commit,
2 years ago
version 6
10c5fec6
1 commit,
2 years ago
version 5
29d261eb
1 commit,
2 years ago
version 4
4d420a7d
1 commit,
2 years ago
version 3
0eed5e2c
1 commit,
2 years ago
version 2
65bdbe47
1 commit,
2 years ago
version 1
dd0aeb5d
1 commit,
2 years ago
Show latest version
22 files
+
1852
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Some changes are not shown
For a faster browsing experience, some files are collapsed by default.
Expand all files
Files
22
Search (e.g. *.vue) (Ctrl+P)
nscharm_policy_vnf/charms/ops/vnf-policy-operator/src/charm.py
0 → 100755
+
27
−
0
Options
#!/usr/bin/env python3
# Copyright 2020 David Garcia
# See LICENSE file for licensing details.
from
ops.main
import
main
from
ops.charm
import
CharmBase
from
ops.model
import
ActiveStatus
class
VnfPolicyCharm
(
CharmBase
):
def
__init__
(
self
,
*
args
):
super
().
__init__
(
*
args
)
# Charm events
self
.
framework
.
observe
(
self
.
on
.
install
,
self
.
_on_install
)
self
.
framework
.
observe
(
self
.
on
.
set_policy_action
,
self
.
_on_set_policy_action
)
def
_on_install
(
self
,
_
):
self
.
unit
.
status
=
ActiveStatus
()
def
_on_set_policy_action
(
self
,
event
):
"""
Set policy action.
"""
event
.
set_results
({
"
updated
"
:
True
})
if
__name__
==
"
__main__
"
:
main
(
VnfPolicyCharm
)
Loading