Skip to content

Commit

Permalink
Merge branch 'master' into storage_controller_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anooprajendra committed Nov 28, 2017
2 parents c842f6d + 02ce5f2 commit d30bf50
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
4 changes: 2 additions & 2 deletions common/src/stack/pylib/stack/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def usage(self):
print(s)
l = len(e)
s = e
if s:
print(s)
if s:
print(s)


def help(self):
Expand Down
26 changes: 25 additions & 1 deletion common/src/stack/sql/insert-ethers.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def __init__(self, app):
self.lastmsg = ''
self.client = ''
self.box = 'default'
self.bootaction = 'default'

self.ipnetwork = None
self.currentip = None
Expand Down Expand Up @@ -242,6 +243,9 @@ def setMax(self, max):
def setBox(self, box):
self.box = box

def setBootaction(self, bootaction):
self.bootaction = bootaction

def setSubnet(self, subnet):
self.subnet = subnet

Expand Down Expand Up @@ -528,6 +532,9 @@ def addit(self, mac, nodename, ip, netmask):
if not rows:
raise InsertError("Could not find %s in database" % nodename)

if self.bootaction:
Call('set.host.installaction', [nodename, 'action=%s' % self.bootaction])

Call('set.host.boot', [nodename, 'action=install'])

nodeid = self.sql.fetchone()[0]
Expand Down Expand Up @@ -707,6 +714,17 @@ def getBox(self):
return 0
return 1

def getBootaction(self):
self.sql.execute("select name from bootnames where name='%s'" % \
(self.bootaction))
box = self.sql.fetchone()
if box is None:
self.warningGUI(_("There is no bootaction named: \
%s\n\n\n\n" % self.bootaction)
+ _("Create it and try again.\n"))
return 0
return 1


def run(self):
self.startGUI()
Expand All @@ -718,6 +736,10 @@ def run(self):
self.endGUI()
return

if self.getBootaction() == 0:
self.endGUI()
return

self.controller.loadPlugins(self.sql)

try:
Expand Down Expand Up @@ -840,6 +862,7 @@ def __init__(self, argv):
('inc=', 'number'),
('rank=', 'number'),
('box=', 'box'),
('bootaction=', 'set the bootaction'),
('update'),
('network=', 'network name')
])
Expand Down Expand Up @@ -870,6 +893,8 @@ def parseArg(self, c):
self.insertor.setBox(c[1])
elif c[0] == '--network':
self.insertor.setSubnet(c[1])
elif c[0] == '--bootaction':
self.insertor.setBootaction(c[1])
return 0


Expand Down Expand Up @@ -904,7 +929,6 @@ def run(self):

self.cleanup()


syslog.openlog('insert-ethers', syslog.LOG_PID, syslog.LOG_LOCAL0)

app = App(sys.argv)
Expand Down
10 changes: 10 additions & 0 deletions redhat/nodes/base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ else:
<stack:package>grub2-tools</stack:package>
<stack:package>wget</stack:package>
<stack:package>bridge-utils</stack:package>
<!-- Network test from stacki-pro -->
<stack:package>iperf3</stack:package>
<stack:package>foundation-iperf</stack:package>
<!-- Don't install the wireless or tv rpms -->
<stack:package stack:enable="false">iwl*</stack:package>
<stack:package stack:enable="false">ivtv*</stack:package>

Expand Down Expand Up @@ -105,6 +109,12 @@ stacki release &version; (&release;)
</stack:file>
</stack:script>

<stack:script stack:cond="sync.hosts" stack:stage="install-post">
<stack:file name="/etc/hosts">
<stack:report name="host"></stack:report>
</stack:file>
</stack:script>

<stack:script stack:stage="install-post" stack:chroot="false">
/opt/stack/bin/stacki-profile.py &gt; /root/prof.log 2&gt;&amp;1

Expand Down
2 changes: 2 additions & 0 deletions redhat/nodes/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ for pallet in g.rolls:
-->
/opt/stack/bin/stack set attr attr=user.auth value=unix

<!-- add sync.hosts to default false -->
/opt/stack/bin/stack set attr attr=sync.hosts value=False
</stack:script>

<stack:script stack:stage="install-post">
Expand Down

0 comments on commit d30bf50

Please sign in to comment.