Cleanup
diff --git a/xos/helloworldservice/admin.py b/xos/helloworldservice/admin.py
index 3b14235..4db2f57 100644
--- a/xos/helloworldservice/admin.py
+++ b/xos/helloworldservice/admin.py
@@ -9,15 +9,13 @@
# The class to provide an admin interface on the web for the service.
# We do only configuration here and don't change any logic because the logic
# is taken care of for us by ReadOnlyAwareAdmin
-
-
class HelloWorldServiceAdmin(ReadOnlyAwareAdmin):
# We must set the model so that the admin knows what fields to use
model = HelloWorldService
verbose_name = "Hello World Service"
verbose_name_plural = "Hello World Services"
- # Setting list_display creats columns on the admin page, each value here
+ # Setting list_display creates columns on the admin page, each value here
# is a column, the column is populated for every instance of the model.
list_display = ("backend_status_icon", "name", "enabled")
@@ -41,7 +39,7 @@
readonly_fields = ('backend_status_text', )
# Inlines are used to denote other models that can be edited on the same
- # form as this one. In this case the service form also alows changes
+ # form as this one. In this case the service form also allows changes
# to slices.
inlines = [SliceInline]
@@ -52,7 +50,7 @@
# Associates fieldsets from this form and from the inlines.
# The format here are tuples, of (<name>, tab title). <name> comes from the
- # <name> in the fielsets.
+ # <name> in the fieldsets.
suit_form_tabs = (('general', 'Hello World Service Details'),
('administration', 'Tenants'),
('slices', 'Slices'),)
@@ -69,15 +67,13 @@
def queryset(self, request):
return HelloWorldService.get_service_objects_by_user(request.user)
-# Class to repsent the form to add and edit tenants.
+# Class to represent the form to add and edit tenants.
# We need to define this instead of just using an admin like we did for the
# service because tenants vary more than services and there isn't a common form.
# This allows us to change the python behavior for the admin form to save extra
# fields and control defaults.
-
-
class HelloWorldTenantForm(forms.ModelForm):
- # Defines a field for the careator of this service. It is a dropbown which
+ # Defines a field for the creator of this service. It is a dropdown which
# is populated with all of the users.
creator = forms.ModelChoiceField(queryset=User.objects.all())
# Defines a text field for the display message, it is not required.
@@ -100,12 +96,11 @@
self.fields[
'display_message'].initial = self.instance.display_message
- # If there is not an instnace then we need to set initial values.
+ # If there is not an instance then we need to set initial values.
if (not self.instance) or (not self.instance.pk):
self.fields['creator'].initial = get_request().user
if HelloWorldService.get_service_objects().exists():
- self.fields["provider_service"].initial = HelloWorldService.get_service_objects().all()[
- 0]
+ self.fields["provider_service"].initial = HelloWorldService.get_service_objects().all()[0]
# This function describes what happens when the save button is pressed on
# the tenant form. In this case we set the values for the instance that were
diff --git a/xos/helloworldservice/models.py b/xos/helloworldservice/models.py
index 4c72416..499c8b4 100644
--- a/xos/helloworldservice/models.py
+++ b/xos/helloworldservice/models.py
@@ -6,8 +6,6 @@
# The class to represent the service. Most of the service logic is given for us
# in the Service class but, we have some configuration that is specific for
# this example.
-
-
class HelloWorldService(Service):
KIND = HELLO_WORLD_KIND
@@ -24,8 +22,6 @@
# This is the class to represent the tenant. Most of the logic is given to use
# in TenantWithContainer, however there is some configuration and logic that
# we need to define for this example.
-
-
class HelloWorldTenant(TenantWithContainer):
class Meta:
@@ -85,9 +81,9 @@
return {}
addresses = {}
- # The ports field refers to networks for the instnace.
+ # The ports field refers to networks for the instance.
# This loop stores the details for the NAT network that will be
- # necessary for ansible..
+ # necessary for ansible.
for ns in self.instance.ports.all():
if "nat" in ns.network.name.lower():
addresses["nat"] = (ns.ip, ns.mac)
diff --git a/xos/helloworldservice/templates/helloworldserviceadmin.html b/xos/helloworldservice/templates/helloworldserviceadmin.html
index 03f36b8..0c60f1a 100644
--- a/xos/helloworldservice/templates/helloworldserviceadmin.html
+++ b/xos/helloworldservice/templates/helloworldserviceadmin.html
@@ -1,4 +1,4 @@
-<!-- Template used to for the button leading to the helloworldteant form. -->
+<!-- Template used to for the button leading to the HelloWorldTenant form. -->
<div class = "left-nav">
<ul>
<li>
diff --git a/xos/observers/helloworldservice/helloworldservice-observer.py b/xos/observers/helloworldservice/helloworldservice-observer.py
index 91bbe96..75dcc46 100755
--- a/xos/observers/helloworldservice/helloworldservice-observer.py
+++ b/xos/observers/helloworldservice/helloworldservice-observer.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# This imports and runs ../../xos-observer.py
-# Runs te standard XOS observer
+# Runs the standard XOS observer
import importlib
import os
diff --git a/xos/observers/helloworldservice/model-deps b/xos/observers/helloworldservice/model-deps
index 1abf313..0967ef4 100644
--- a/xos/observers/helloworldservice/model-deps
+++ b/xos/observers/helloworldservice/model-deps
@@ -1,206 +1 @@
-{
- "Slice": [
- "Site",
- "Service",
- "ServiceClass",
- "User"
- ],
- "ImageDeployments": [
- "Image",
- "Deployment"
- ],
- "ControllerImages": [
- "Image",
- "Controller"
- ],
- "ReservedResource": [
- "Instance"
- ],
- "HpcHealthCheck": [
- "HpcService"
- ],
- "ControllerNetwork": [
- "Network",
- "Controller"
- ],
- "OriginServer": [
- "ContentProvider"
- ],
- "NetworkSlice": [
- "Network",
- "Slice"
- ],
- "Instance": [
- "Image",
- "User",
- "Slice",
- "Deployment",
- "Node",
- "Flavor"
- ],
- "Charge": [
- "Account",
- "Slice",
- "Invoice"
- ],
- "ControllerSite": [
- "Site",
- "Controller"
- ],
- "Node": [
- "Site"
- ],
- "ControllerSlice": [
- "Controller",
- "Slice"
- ],
- "ServiceMap": [
- "Slice"
- ],
- "VCPETenant": [
- "Provider",
- "Subscriber"
- ],
- "ControllerSitePrivilege": [
- "Controller",
- "Site"
- ],
- "ControllerUser": [
- "User",
- "Controller"
- ],
- "VOLTTenant": [
- "Provider",
- "Subscriber"
- ],
- "UserCredential": [
- "User"
- ],
- "UserDashboardView": [
- "User",
- "DashboardView"
- ],
- "Controller": [
- "Deployment"
- ],
- "User": [
- "Site"
- ],
- "SliceTag": [
- "Slice"
- ],
- "VBNGTenant": [
- "Provider",
- "Subscriber"
- ],
- "Reservation": [
- "Slice"
- ],
- "ServiceResource": [
- "ServiceClass"
- ],
- "Payment": [
- "Account"
- ],
- "ServicePrivilege": [
- "User",
- "Service",
- "Role"
- ],
- "ONOSApp": [
- "Provider",
- "Subscriber"
- ],
- "ServiceProvider": [
- "HpcService"
- ],
- "Account": [
- "Site"
- ],
- "ServiceAttribute": [
- "Service"
- ],
- "ControllerSlicePrivilege": [
- "Controller",
- "Slice"
- ],
- "TenantWithContainer": [
- "Provider",
- "Subscriber"
- ],
- "SiteDeployment": [
- "Site",
- "Deployment",
- "Controller"
- ],
- "TenantAttribute": [
- "Tenant"
- ],
- "SlicePrivilege": [
- "User",
- "Slice",
- "Role"
- ],
- "SitePrivilege": [
- "User",
- "Site",
- "Role"
- ],
- "AccessMap": [
- "ContentProvider"
- ],
- "HelloWorldTenant": [
- "Provider",
- "Subscriber"
- ],
- "SiteCredential": [
- "Site"
- ],
- "DeploymentPrivilege": [
- "User",
- "Deployment",
- "Role"
- ],
- "CDNPrefix": [
- "ContentProvider"
- ],
- "TenantRootPrivilege": [
- "User",
- "Tenant",
- "Role"
- ],
- "ControllerDashboardView": [
- "Controller",
- "DashboardView"
- ],
- "Tag": [
- "Service"
- ],
- "Tenant": [
- "Provider",
- "Subscriber"
- ],
- "Invoice": [
- "Account"
- ],
- "CoarseTenant": [
- "Provider",
- "Subscriber"
- ],
- "SliceCredential": [
- "Slice"
- ],
- "ContentProvider": [
- "ServiceProvider"
- ],
- "Port": [
- "Network",
- "Instance"
- ],
- "SiteMap": [
- "ContentProvider",
- "ServiceProvider",
- "CDNPrefix",
- "HpcService"
- ]
-}
+{}
diff --git a/xos/observers/helloworldservice/steps/sync_helloworldtenant.py b/xos/observers/helloworldservice/steps/sync_helloworldtenant.py
index e129d7f..c959999 100644
--- a/xos/observers/helloworldservice/steps/sync_helloworldtenant.py
+++ b/xos/observers/helloworldservice/steps/sync_helloworldtenant.py
@@ -11,15 +11,13 @@
# indicate where the find the YAML for ansible, where to find the SSH key,
# and the logic for determining what tenant needs updating, what additional
# attributes are needed, and how to delete an instance.
-
-
class SyncHelloWorldServiceTenant(SyncInstanceUsingAnsible):
# Indicates the position in the data model, this will run when XOS needs to
# enact a HelloWorldTenant
provides = [HelloWorldTenant]
# The actual model being enacted, usually the same as provides.
observes = HelloWorldTenant
- # Number of miliseconds between interruptions of the observer
+ # Number of milliseconds between interruptions of the observer
requested_interval = 0
# The ansible template to run
template_name = "sync_helloworldtenant.yaml"
diff --git a/xos/observers/helloworldservice/steps/sync_helloworldtenant.yaml b/xos/observers/helloworldservice/steps/sync_helloworldtenant.yaml
index 8563a2e..719c75f 100644
--- a/xos/observers/helloworldservice/steps/sync_helloworldtenant.yaml
+++ b/xos/observers/helloworldservice/steps/sync_helloworldtenant.yaml
@@ -4,8 +4,6 @@
connection: ssh
user: ubuntu
sudo: yes
- vars:
- display_message: {{ display_message }}
tasks:
- name: install apache
apt: name=apache2 state=present update_cache=yes