Network configuration idea -- bridges
by Michael DeHaan
Wouldn't it be nice to be able to create bridges as well in the network
interfaces for system records?
You get one for free with xenbr0, but for KVM, you have to hand-create
it (virbr0) is not a bridge.
How's this for a possible extension to what the
post_install_network_script things do?
--Michael
15 years, 1 month
django webui
by James Cammarata
Since I've made some pretty good progress on this in the last couple of
days, I went ahead and moved it into the main cobbler directory:
$ ls django-webui/
apache django_templates djangowebui javascript
GitHub: git://github.com/jimi1283/cobbler.git, in the my-devel branch
If you want to run this, copy the .conf file from apache/ to your
httpd/conf.d/ directory, and copy the djangowebui/django_templates
directory to /var/www/cobbler. Currently all paths are hard coded in the
django settings, so you MUST put these files in /var/www/cobbler. Finally,
any javascript files (currently only one, but there will be more) should be
put in /var/www/cobbler/webui. The rest of the graphics/css/javascript is
already there.
One weird thing django does, is generate a "secret key" (from settings.py):
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'w&x*74x-b=ycigsdya03699o!9kt4(z4wyx-us9q=--&7clv4='
I have no idea what this is used for currently, if someone else knows
django better and can shed light on how we should handle this it would be
appreciated.
Current state of the code:
* Views for distros/profiles/systems work, as do the templates for the
list/edit/search. No forms work at all, so you can't save anything.
* Pagination is commented out, kind of ignoring that for now.
* Interfaces on the system edit page are broken badly. Django does not let
you put much python in templates, so all of that logic will need to be
moved into the views.py file.
* Still working on the alternate system views (copy, rename, etc.), those
don't work yet either.
* No logging in yet, it's hard coded as testing/testing in the views.py
file, so you'll have to setup your authnz to use the testing module.
Obviously this is heavily in dev so don't do this in a production
environment.
All told, I figure this is about 25-33% done right now. Any questions, let
me know! :)
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
15 years, 1 month
PATCH: fix cobbler's default yaml output.
by brett lentz
Ticket filed here: https://fedorahosted.org/cobbler/ticket/413
The current defaults are backwards. While it's still syntactically
valid YAML, it will cause Puppet to choke, throwing an obscure "Can't
convert String to Integer" error.
This patch just corrects the default values, and the inconsistency. If
cobbler knows about the host, it returns YAML with the correct
formatting. (i.e. classes: [someclass]) So, it's also slightly
inconsistent behavior to return "classes: {}" when there's no
assigned classes.
---Brett.
--- services.py.orig 2009-03-30 12:58:40.000000000 -0700
+++ services.py 2009-03-30 12:58:41.000000000 -0700
@@ -222,8 +222,8 @@
results = self.remote.find_system_by_dns_name(hostname)
- classes = results.get("mgmt_classes", {})
- params = results.get("mgmt_parameters",[])
+ classes = results.get("mgmt_classes", [])
+ params = results.get("mgmt_parameters",{})
newdata = {
"classes" : classes,
15 years, 1 month
Debian import & deployment
by Javier Palacios
Hello,
as I messed up the debian branch with stuff from standard devel, I did
setup a new github repository, and I realized that most of the patches
are already there, except for the last one.
The new github (with only one that patch, respect to yesterday's devel) is at
http://github.com/javiplx/cobbler-debian/tree/cobbler-debian
I've modified the wiki page where remote branchs are listed, and the
wiki page about (alternate) debian deployments at
https://fedorahosted.org/cobbler/wiki/AlternateDebianDeployment
I was able to use the method described there to test on a real
machine, but up to now I've failed to repeat that with full
virtualization, due to problems with libvirt.
Javier Palacios
15 years, 1 month
[PATCH] Issues when reporting with --fields
by Adam Rosenwald
Tested against b2aaf2b3f5c8d758825028dacdeadbdd2e50e4a8. Please commit.
Purpose of patch:
Examples:
(1) Prior to patch, try running 'cobbler report --format=mediawiki
--fields=hostname --what=repos'. In this case, one will receive a stack
trace, since 'hostname' is not a field for a "distro" item.
(2) Prior to patch, try running 'cobbler report --format=mediawiki
--fields=ks_meta[X] --what=systems', where "X" is some metavariable key
in an 'X=Y' statement. In this case, if some set of systems contain
"ks_meta: 'X=Y,...'" and others do not, then a stack trace will occur
when reporting encounters one of the latter items.
---
Everything should be fixed now w.r.t. these kinds of edge case issues.
If there are more, please post them to the cobbler-devel list.
Regards,
- A.
>From c7f08e43d3f1782b1b64931fccb3f6e36d2e8edd Mon Sep 17 00:00:00 2001
From: Adam Rosenwald <thestrider(a)gmail.com>
Date: Mon, 6 Apr 2009 22:28:10 -0400
Subject: [PATCH] Fixed issues when reporting on a set of fields that do not exist
within a collection.
ARos
---
cobbler/action_report.py | 47 +++++++++++++++++++++++++++++----------------
1 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/cobbler/action_report.py b/cobbler/action_report.py
index 6e6c5ea..9f4367e 100644
--- a/cobbler/action_report.py
+++ b/cobbler/action_report.py
@@ -45,23 +45,21 @@ class Report:
item = {}
for field in fields_list:
-
+
+ internal = self.array_re.search(field)
+ # check if field is primary field
if field in structure.keys():
item[field] = structure[field]
-
- # exception for fields within fields (depth=1 for now)
- elif self.array_re.search(field):
- internal = self.array_re.search(field)
- item[internal.group(2)] = structure[internal.group(1)][internal.group(2)]
- # exception for systems which could have > 1 interface
+ # check if subfield in 'interfaces' field
+ elif internal and internal.group(1) in structure.keys():
+ outer = internal.group(1)
+ inner = internal.group(2)
+ if type(structure[outer]) is type({}) and inner in structure[outer]:
+ item[field] = structure[outer][inner]
elif "interfaces" in structure.keys():
for device in structure['interfaces'].keys():
if field in structure['interfaces'][device]:
item[field] = device + ': ' + structure['interfaces'][device][field]
- else:
- raise CX(_("The field \"%s\" does not exist, see cobbler dumpvars for available fields.") % field)
- else:
- raise CX(_("The field \"%s\" does not exist, see cobbler dumpvars for available fields.") % field)
return item
def reporting_csv(self, info, order, noheaders):
@@ -81,7 +79,10 @@ class Report:
if info_count == 0:
outputheaders += str(key) + sep
- outputbody += str(item[key]) + sep
+ if key in item.keys():
+ outputbody += str(item[key]) + sep
+ else:
+ outputbody += '-' + sep
item_count = item_count + 1
@@ -113,7 +114,10 @@ class Report:
if info_count == 0:
outputheaders += sep + str(key)
- outputbody += sep + str(item[key])
+ if key in item.keys():
+ outputbody += sep + str(item[key])
+ else:
+ outputbody += sep + '-'
item_count = item_count + 1
@@ -146,7 +150,10 @@ class Report:
if info_count == 0:
outputheaders += sep1 + key
- outputbody += sep2 + item[key]
+ if key in item.keys():
+ outputbody += sep2 + item[key]
+ else:
+ outputbody += sep2 + '-'
item_count = item_count + 1
@@ -185,9 +192,15 @@ class Report:
outputheaders += sep1 + key
if item_count == 0:
- outputbody += sep2 + str(item[key])
+ if key in item.keys():
+ outputbody += sep2 + str(item[key])
+ else:
+ outputbody += sep2 + '-'
else:
- outputbody += sep1 + str(item[key])
+ if key in item.keys():
+ outputbody += sep1 + str(item[key])
+ else:
+ outputbody += sep1 + '-'
item_count = item_count + 1
@@ -308,7 +321,7 @@ class Report:
item = self.fielder(structure, fields_list)
data.append(item)
- self.print_formatted_data(data = data, order = item.keys(), report_type = report_type, noheaders = report_noheaders)
+ self.print_formatted_data(data = data, order = fields_list, report_type = report_type, noheaders = report_noheaders)
return True
--
1.5.5.1
15 years, 1 month
[PATCH] Ignore non-present network interfaces in post_install_network_config
by Justin Sherrill
If during execution of this snippit $IFNAME is empty, the the script
will end up executing:
grep $IFNAME /etc/modprobe.conf
which will be:
grep /etc/modprobe.conf
this never will return and results in a hung kickstart. Now the only
reason IFNAME would be null is if at provisioning time, an interface
specified in the system record wasn't present. This might be an 'error
case', but it would be more ideal to simply ignore the interface than to
hang.
Here's the patch:
index e6839f7..7191087 100644
--- a/snippets/post_install_network_config
+++ b/snippets/post_install_network_config
@@ -100,7 +100,7 @@ fi
IFNAME=\$(ifconfig -a | grep -i '$mac' | cut -d ' ' -f 1)
## Rename this interface in modprobe.conf
## FIXME: if both interfaces startwith eth this is wrong
-if [ -f "/etc/modprobe.conf" ]; then
+if [ -f "/etc/modprobe.conf" ] && [ $IFNAME ]; then
grep \$IFNAME /etc/modprobe.conf | sed "s/\$IFNAME/$iname/" >>
/etc/modprobe.conf.cobbler
grep -v \$IFNAME /etc/modprobe.conf >> /etc/modprobe.conf.new
rm -f /etc/modprobe.conf
--
Justin Sherrill, RHCA 1801 Varisty Drive.
Software Engineer Raleigh, NC 27603
Red Hat, Inc.
15 years, 1 month
Combining git repos for cobbler and koan
by Michael DeHaan
It makes perfect sense to be able to send one patchset against Cobbler
and koan at the same time, as well as branching/tagging cobbler and koan
at the same time.
So, in the spirit of the above, I've merged koan (with history) into
Cobbler's repo, and will be removing koan's repos.
Koan lives in a subdirectory called "koan" and over time (on devel) I'll
work on merging things like the authors file and READMEs and little
stuff like that.
For those that are git fans, this is pretty amazing:
http://www.kernel.org/pub/software/scm/git-core/docs/howto/using-merge-su...
This shouldn't upset anyone with outstanding cobbler development right
now, and if there are koan patches that need massaging I'll deal with
it. Wiki docs will be updated shortly
and I'll file the ticket to blow away koan at
http://fedorahosted.org/koan and git.fedorahosted.org/koan.
--Michael
15 years, 1 month
api.find_system and remote.get_system
by Vreman, Peter
There is a difference in the internal and remote api.
The internal api has find_system to retrieve a single or multiple items with an optional filter.
The remote api has a dedicated get_system to retrieve a single item
Can this be changed to:
Api.find_systems(matchtype,**kvargs) returns a list
Api.get_system(name) returns a item
Api.get_systems returns a list
Remote.find_systems(matchtype,page,results_per_page,**kvargs) returns a list
Remote.get_system(name) returns a item
Remote.get_systems() returns a list
This makes it more consistent and transparent. The remote functions will become simple wrappers. Eventually the paginate function can also be merged into the Api instead of Remote.
Thoughts?
Regards,
Peter
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
15 years, 1 month