VNF Primitive Upgrade: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
(Created page with "The purpose of the Upgrade primitive is to perform an upgrade of operational software on your VNF. Implementing the primitive is optional. <code> <pre> @when('actions.upgrad...")
 
No edit summary
Line 1: Line 1:
'''DISCLAIMER: This page is being updated to reflect changes required for Release FOUR.'''
The purpose of the Upgrade primitive is to perform an upgrade of operational software on your VNF.
The purpose of the Upgrade primitive is to perform an upgrade of operational software on your VNF.


Implementing the primitive is optional.
Implementing the primitive is optional.


<code>
<pre>
<pre>
@when('actions.upgrade')
@when('actions.upgrade')
Line 9: Line 10:
     err = ''
     err = ''
     try:
     try:
        # Run the command(s) necessary to perform a safe software upgrade of your VNF
         result, err = charms.sshproxy._run("/srv/myvnf/upgrade.sh")
         result, err = charms.sshproxy._run("/srv/myvnf/upgrade.sh")
     except:
     except:
Line 17: Line 19:
         clear_flag('actions.upgrade')
         clear_flag('actions.upgrade')
</pre>
</pre>
</code>
 
For a full example of creating a VNF charm, please see [[Creating your own VNF charm (Release FOUR)]].

Revision as of 08:51, 26 June 2018

DISCLAIMER: This page is being updated to reflect changes required for Release FOUR.

The purpose of the Upgrade primitive is to perform an upgrade of operational software on your VNF.

Implementing the primitive is optional.

@when('actions.upgrade')
def upgrade_vnf():
    err = ''
    try:
        # Run the command(s) necessary to perform a safe software upgrade of your VNF
        result, err = charms.sshproxy._run("/srv/myvnf/upgrade.sh")
    except:
        action_fail('command failed:' + err)
    else:
        action_set({'outout': result})
    finally:
        clear_flag('actions.upgrade')

For a full example of creating a VNF charm, please see Creating your own VNF charm (Release FOUR).