Skip to content
Browse files

Added freebsd mirror support for ezjail install. User form now allows…

… selecting the group membership.
  • Loading branch information...
1 parent b6d0155 commit c733aa400e93091aa47a4398173c2814088e0867 @masom committed Feb 15, 2012
View
2 README.md
@@ -49,7 +49,7 @@ If an image is uploaded with euca2ools, the glance entry must be updated to refl
image_type: qcow2
# Installation
-Configure `setup/bootstrap.sh` to match your environment (mostly just change the url of the package site).
+Configure `setup/setup.sh` to match your environment (mostly just change the url of the package site).
The boostrap file should be included in the virtual machine base image and be run during the first boot.
View
4 client/lib/jails.py
@@ -161,12 +161,12 @@ def setSocket(self, ezjl_socket):
'''Set the socket used to communicate with the fork handling jail start.'''
self._socket = ezjl_socket
- def install(self):
+ def install(self, mirror='ftp.freebsd.org'):
'''
Installs ezjail
@raise OSError when command not found.
'''
- command = '%s install -m -p' % self._prog
+ command = '%s install -m -h %s' % (self._prog, mirror)
self.logs.append(command)
subprocess.Popen(shlex.split(command)).wait()
View
9 client/lib/setup_plugin.py
@@ -55,7 +55,7 @@ def run(self):
try:
self._enable_ezjail()
- self.ezjail.install()
+ EzJail().install(cherrypy.config.get('setup_plugin.ftp_mirror'))
except (IOError, OSError) as e:
self.log("Error while installing ezjail: %s" % e)
return False
@@ -122,8 +122,9 @@ def _calculate_alias_count(self, addresses, rc):
return alias_count
def _add_ip(self, ip, netmask):
- command = "ifconfig %s alias %s netmask %s" % (self.vm.interfaces, ip, netmask)
- subprocess.Popen(shlex.split(command)).wait()
+ command = "ifconfig %s alias %s netmask %s" % (self.vm.interface, ip, netmask)
+ self.log('executing: `%s`' % command)
+ subprocess.Popen(shlex.split(str(command))).wait()
def _add_rc_ip(self, rc_addresses, file, alias_count, ip, netmask):
@@ -201,7 +202,7 @@ def _retrieveFlavours(self):
self.log("Error while retrieving jail `%s`: %s" % (jail.name, e))
return False
- tmpfiles.append({'type': jail.jail.jail_type, 'tmp_file': filename})
+ tmpfiles.append({'type': jail.jail_type, 'tmp_file': filename})
self.log("Jail `%s` downloaded at `%s`" % (jail.name, filename))
return tmpfiles
View
1 client/pixie.conf
@@ -7,6 +7,7 @@ log.error_file = "/var/log/pixie_error.log"
setup_plugin.jail_dir = "/usr/local/jails"
setup_plugin.yum_repo_dir = "/usr/local/etc/yum.repos.d"
+setup_plugin.ftp_mirror = "10.0.253.23"
puck.registration_file = "/usr/local/etc/puck_registration"
puck.api_url = "http://localhost:8080/api"
View
4 server/controllers/users.py
@@ -36,7 +36,7 @@ def add(self, **post):
meta, auth_meta = self.get_meta()
if post:
- fields = ['name', 'username', 'email']
+ fields = ['name', 'username', 'email', 'user_group']
data = self._get_data('user', fields, post)
self._set_data(user, data)
auth_meta = self._get_data('auth_meta', meta, post)
@@ -98,7 +98,7 @@ def edit(self, id, **post):
pass
if post:
- fields = ['name', 'username', 'email']
+ fields = ['name', 'username', 'email', 'user_group']
data = self._get_data('user', fields, post)
self._set_data(user, data)
auth_meta = self._get_data('auth_meta', meta, post)
View
0 server/setup.py
No changes.
View
16 server/views/users/form.html
@@ -10,7 +10,21 @@
<legend>User</legend>
<ul>
<li>
- <label for="username">Username</label>
+ <label for="user.group">Group</label>
+ <select id="user.user_group" name="user.user_group">
+ % for g in ['user', 'admin']:
+ <%
+ if user.user_group == g:
+ selected = 'selected'
+ else:
+ selected = ''
+ %>
+ <option value="${g}" ${selected}>${g}</option>
+ % endfor
+ </select>
+ </li>
+ <li>
+ <label for="user.username">Username</label>
<input id="user.username" name="user.username" type="text" value="${user.username}" required />
</li>
<li>
View
3 server/views/users/index.html
@@ -13,9 +13,10 @@
% else:
<div class="index">
<table cellspacing="0" colspan="0">
- <tr><th>Username</th><th>Name</th><th>Email</th></tr>
+ <tr><th>Group</th><th>Username</th><th>Name</th><th>Email</th></tr>
% for user in users:
<tr>
+ <td>${user.user_group}</td>
<td>${user.username}</td>
<td>${user.name}</td>
<td>${user.email}</td>
View
3 setup/setup.sh
@@ -55,6 +55,9 @@ pkg_info | /usr/local/bin/python registerports.py
########################
rpm -ivh *.rpm
+tar -xzf pixie.tar.gz -C /usr/local/
+cp pixie.conf /usr/local/etc/pixie.conf
+
cd $START
rm -rf $DEST

0 comments on commit c733aa4

Please sign in to comment.
Something went wrong with that request. Please try again.