Skip to content

Commit 5914e36

Browse files
author
Josh Gachnang
committed
Replacing teeth/overlord with ipa/ironic
1 parent b30d345 commit 5914e36

35 files changed

+158
-147
lines changed

.testr.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[DEFAULT]
2-
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -s teeth_agent/tests/ -p "*.py" $LISTOPT $IDOPTION
2+
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -s ironic_python_agent/tests/ -p "*.py" $LISTOPT $IDOPTION
33
test_id_option=--load-list $IDFILE
44
test_list_option=--list

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM jayofdoom/docker-ubuntu-14.04
22

3+
#TODO(pcsforeducation) ask Jay what we can change here
4+
35
# The add is before the RUN to ensure we get the latest version of packages
46
# Docker will cache RUN commands, but because the SHA1 of the dir will be
57
# different it will not cache this layer

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# teeth-agent
1+
# ironic-python-agent
22

33
[![Build Status](https://travis-ci.org/rackerlabs/teeth-agent.png?branch=master)](https://travis-ci.org/rackerlabs/teeth-agent)
44

5-
An agent for rebuilding and controlling Teeth chassis.
5+
An agent for rebuilding and controlling Ironic nodes.

ironic_python_agent/agent.py

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@
1818
import threading
1919
import time
2020

21+
from ironic_python_agent.api import app
22+
from ironic_python_agent import base
23+
from ironic_python_agent import encoding
24+
from ironic_python_agent import errors
25+
from ironic_python_agent import hardware
26+
from ironic_python_agent import ironic_api_client
27+
from ironic_python_agent.openstack.common import log
28+
from ironic_python_agent import utils
29+
2130
import pkg_resources
2231
from stevedore import driver
2332
from wsgiref import simple_server
2433

25-
from teeth_agent.api import app
26-
from teeth_agent import base
27-
from teeth_agent import encoding
28-
from teeth_agent import errors
29-
from teeth_agent import hardware
30-
from teeth_agent.openstack.common import log
31-
from teeth_agent import overlord_agent_api
32-
from teeth_agent import utils
33-
3434

3535
def _time():
3636
"""Wraps time.time() for simpler testing."""
3737
return time.time()
3838

3939

40-
class TeethAgentStatus(encoding.Serializable):
40+
class IronicPythonAgentStatus(encoding.Serializable):
4141
def __init__(self, mode, started_at, version):
4242
self.mode = mode
4343
self.started_at = started_at
@@ -52,7 +52,7 @@ def serialize(self):
5252
])
5353

5454

55-
class TeethAgentHeartbeater(threading.Thread):
55+
class IronicPythonAgentHeartbeater(threading.Thread):
5656
# If we could wait at most N seconds between heartbeats (or in case of an
5757
# error) we will instead wait r x N seconds, where r is a random value
5858
# between these multipliers.
@@ -67,10 +67,10 @@ class TeethAgentHeartbeater(threading.Thread):
6767
backoff_factor = 2.7
6868

6969
def __init__(self, agent):
70-
super(TeethAgentHeartbeater, self).__init__()
70+
super(IronicPythonAgentHeartbeater, self).__init__()
7171
self.agent = agent
7272
self.hardware = hardware.get_manager()
73-
self.api = overlord_agent_api.APIClient(agent.api_url)
73+
self.api = ironic_api_client.APIClient(agent.api_url)
7474
self.log = log.getLogger(__name__)
7575
self.stop_event = threading.Event()
7676
self.error_delay = self.initial_delay
@@ -111,17 +111,18 @@ def stop(self):
111111
return self.join()
112112

113113

114-
class TeethAgent(object):
114+
class IronicPythonAgent(object):
115115
def __init__(self, api_url, advertise_address, listen_address):
116116
self.api_url = api_url
117-
self.api_client = overlord_agent_api.APIClient(self.api_url)
117+
self.api_client = ironic_api_client.APIClient(self.api_url)
118118
self.listen_address = listen_address
119119
self.advertise_address = advertise_address
120120
self.mode_implementation = None
121-
self.version = pkg_resources.get_distribution('teeth-agent').version
121+
self.version = pkg_resources.get_distribution('ironic-python-agent')\
122+
.version
122123
self.api = app.VersionSelectorApplication(self)
123124
self.command_results = utils.get_ordereddict()
124-
self.heartbeater = TeethAgentHeartbeater(self)
125+
self.heartbeater = IronicPythonAgentHeartbeater(self)
125126
self.hardware = hardware.get_manager()
126127
self.command_lock = threading.Lock()
127128
self.log = log.getLogger(__name__)
@@ -136,7 +137,7 @@ def get_mode_name(self):
136137

137138
def get_status(self):
138139
"""Retrieve a serializable status."""
139-
return TeethAgentStatus(
140+
return IronicPythonAgentStatus(
140141
mode=self.get_mode_name(),
141142
started_at=self.started_at,
142143
version=self.version
@@ -209,7 +210,7 @@ def execute_command(self, command_name, **kwargs):
209210
return result
210211

211212
def run(self):
212-
"""Run the Teeth Agent."""
213+
"""Run the Ironic Python Agent."""
213214
self.started_at = _time()
214215
# Get the UUID so we can heartbeat to Ironic
215216
self.node = self.api_client.lookup_node(
@@ -232,7 +233,7 @@ def run(self):
232233

233234
def _load_mode_implementation(mode_name):
234235
mgr = driver.DriverManager(
235-
namespace='teeth_agent.modes',
236+
namespace='ironic_python_agent.modes',
236237
name=mode_name.lower(),
237238
invoke_on_load=True,
238239
invoke_args=[],
@@ -246,6 +247,6 @@ def build_agent(api_url,
246247
listen_host,
247248
listen_port):
248249

249-
return TeethAgent(api_url,
250-
(advertise_host, advertise_port),
251-
(listen_host, listen_port))
250+
return IronicPythonAgent(api_url,
251+
(advertise_host, advertise_port),
252+
(listen_host, listen_port))

ironic_python_agent/api/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pecan
1818
from pecan import hooks
1919

20-
from teeth_agent.api import config
20+
from ironic_python_agent.api import config
2121

2222

2323
class AgentHook(hooks.PecanHook):

ironic_python_agent/api/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
# Pecan Application Configurations
2525
# See https://pecan.readthedocs.org/en/latest/configuration.html#application-configuration # noqa
2626
app = {
27-
'root': 'teeth_agent.api.controllers.root.RootController',
28-
'modules': ['teeth_agent.api'],
27+
'root': 'ironic_python_agent.api.controllers.root.RootController',
28+
'modules': ['ironic_python_agent.api'],
2929
'static_root': '%(confdir)s/public',
3030
'debug': False,
3131
'enable_acl': True,

ironic_python_agent/api/controllers/root.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
from wsme import types as wtypes
1919
import wsmeext.pecan as wsme_pecan
2020

21-
from teeth_agent.api.controllers import v1
22-
from teeth_agent.api.controllers.v1 import base
23-
from teeth_agent.api.controllers.v1 import link
21+
from ironic_python_agent.api.controllers import v1
22+
from ironic_python_agent.api.controllers.v1 import base
23+
from ironic_python_agent.api.controllers.v1 import link
2424

2525

2626
class Version(base.APIBase):

ironic_python_agent/api/controllers/v1/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
from wsme import types as wtypes
2323
import wsmeext.pecan as wsme_pecan
2424

25-
from teeth_agent.api.controllers.v1 import base
26-
from teeth_agent.api.controllers.v1 import command
27-
from teeth_agent.api.controllers.v1 import link
28-
from teeth_agent.api.controllers.v1 import status
25+
from ironic_python_agent.api.controllers.v1 import base
26+
from ironic_python_agent.api.controllers.v1 import command
27+
from ironic_python_agent.api.controllers.v1 import link
28+
from ironic_python_agent.api.controllers.v1 import status
2929

3030

3131
class MediaType(base.APIBase):

ironic_python_agent/api/controllers/v1/command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from wsme import types
1919
from wsmeext import pecan as wsme_pecan
2020

21-
from teeth_agent.api.controllers.v1 import base
21+
from ironic_python_agent.api.controllers.v1 import base
2222

2323

2424
class CommandResult(base.APIBase):

ironic_python_agent/api/controllers/v1/link.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from wsme import types as wtypes
1717

18-
from teeth_agent.api.controllers.v1 import base
18+
from ironic_python_agent.api.controllers.v1 import base
1919

2020

2121
class Link(base.APIBase):

0 commit comments

Comments
 (0)