Commit 89f08427 authored by Robert Ricci's avatar Robert Ricci

Update to more "modern" sytle

parent 4f714a7b
"""An example of constructing a profile with install and execute services.
Instructions:
Wait for the profile instance to start, then click on the node in the topology and choose the `shell` menu item. The install and execute services are handled automatically during profile instantiation, with no manual intervention required.
Wait for the profile instance to start, then click on the node in the topology
and choose the `shell` menu item. The install and execute services are handled
automatically during profile instantiation, with no manual intervention required.
"""
# Import the Portal object.
import geni.portal as portal
# Import the ProtoGENI library.
import geni.rspec.pg as pg
# Create a portal context.
pc = portal.Context()
import geni.rspec.pg as rspec
# Create a Request object to start building the RSpec.
request = pc.makeRequestRSpec()
request = portal.context.makeRequestRSpec()
# Add a raw PC to the request.
node = request.RawPC("node")
# Install and execute scripts on the node. THIS TAR FILE DOES NOT ACTUALLY EXIST!
node.addService(pg.Install(url="http://example.org/sample.tar.gz", path="/local"))
node.addService(pg.Execute(shell="bash", command="/local/example.sh"))
node.addService(rspec.Install(url="http://example.org/sample.tar.gz", path="/local"))
node.addService(rspec.Execute(shell="bash", command="/local/example.sh"))
# Print the RSpec to the enclosing page.
pc.printRequestRSpec(request)
portal.context.printRequestRSpec()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment