[PATCH] Silenced wget's output since it doesn't respect stdout.
by Benjamin Riggs
'$ wget http://... > /dev/null' doesn't actually silence wget's spammy
output, so I added the -q flag.
'$ koan --update-files ...' still displays url & destination file, but
can be silenced with a '> /dev/null'.
--
Benjamin Riggs
System Staff
School of Mathematics
University of Minnesota
>From a1be63dc63427193f0d4da5bfdab10fed7cce001 Mon Sep 17 00:00:00 2001
From: Benjamin Riggs <riggs(a)umn.edu>
Date: Tue, 31 Mar 2009 15:27:54 -0500
Subject: [PATCH] Silenced wget's output since it doesn't respect stdout.
---
koan/app.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/koan/app.py b/koan/app.py
index 92cf007..6fa46df 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -634,7 +634,7 @@ class Koan:
url = pattern % (profile_data["http_server"],"profile",profile_data["name"],dest)
if not os.path.exists(os.path.dirname(save_as)):
os.makedirs(os.path.dirname(save_as))
- cmd = [ "/usr/bin/wget", url, "--output-document", save_as ]
+ cmd = [ "/usr/bin/wget", "-q", url, "--output-document", save_as ]
utils.subprocess_call(cmd)
return True
--
1.6.0.6
15 years
[PATCH 1/2] Quiet condrestart in spec file %post
by Todd Zullinger
This ensures that the %post scriptlet exits cleanly and prevents
"Stopping cobbler daemon: [ OK ]" messages from littering the screen
on updates.
---
Patch is also attached for use with git am. :)
cobbler.spec | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cobbler.spec b/cobbler.spec
index c3a9049..57ea7e5 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -113,7 +113,7 @@ done
# reserialize and restart
/usr/bin/cobbler reserialize
/sbin/chkconfig --add cobblerd
-/sbin/service cobblerd condrestart
+/sbin/service cobblerd condrestart >/dev/null 2>&1 || :
%preun
if [ $1 = 0 ]; then
--
1.6.2
15 years
Re: WebUI search patch
by Michael DeHaan
Vreman, Peter - Acision wrote:
>
> Hi Michael,
>
> Please find attached the webui_search.diff patch as a regular diff.
> The git-format-patch doesn’t work for me.
>
Will review shortly... thank you!
How is git-format-patch not working for you? Perhaps we can help?
--Michael
> Features
>
> - paginate search results
>
> - quickfilter
>
> - allow ~ to negate a compare in search
>
> - minor log improvements
>
> Todos
>
> - Delete filters
>
> - Modify filters (Load filter does not work yet)
>
> - Allow filter names per collection only. I guess I Need to combine
> the filter.name with the filter.what field somehow.
>
> Please feel free to commit the current work if you like it.
>
> 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
[Patches] Importing debian distros
by Javier Palacios
Hello to all,
I've updated the content of
https://fedorahosted.org/cobbler/wiki/AlternateDebianDeployment
and created proper patches for current devel version. The github is at
http://github.com/javiplx/debian-devel/commits/debian-devel, and I've
tried to split as much as possible to make easier to examine.
The first three patches are fixes for bugs I've found, probably not so
clear for redhat distros, but required to allow debian imports. The
target of the other patches is basically to add --os-version support
to cobbler-import and cobbler-repo. The option is required for import,
but for repos it could be considered a "feature". It is very useful
for debian because makes straightforward to create a repo for a
different version or architecture just by copying an existing.
I cannot perform a real deployment test right now, but I will inform
as soon as I do.
Javier palacios
15 years
remote function get_distros vs. find_distro
by Vreman, Peter
What shall I do with the remote XMLRPC functions for retrieving items with optional filter criteria and paging?
I prefer to only have a get_distros(criteria={},expand=False,page=None,results_per_page=None) that handles everything. The find_distro() can then be removed or reimplemented to find a single distribution based on a name.
Any comments?
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
redirect url
by Vreman, Peter
How can I implement a URL redirect?
For example is the System Netboot code does the listing by generating the html output using system_list:
return self.system_list()
but the URL and the POST are still mode=system_netboot. So pressing F5 will try to repost.
With the search I have the same situation. The search_execute calls xxxxx_list() to display the results. But the URL keeps search_execute and the POST.
A method return self.redirect("mode=system_list&.....") might solve the issue.
Another way might be that the system_list.tmpl does a document.url rewrite?
Any other ideas?
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
remote api internal_cache and temporary objects
by Vreman, Peter
I want to store a temporary object in a collection. The temporary object does not need to be serialized to the disk. When I create the object and call the save_xxxx function with save=False the object is stored in the list. But there is something in collection.add() with _internal_cache_update that is only called when Save=True.
Some questions about caches and values:
- Are the internal_caches still required?
- Why is the internal_cache only updated when the data is serialized to disk?
- What does the to_datastruct_with_cache() provide in addition or is a replacement?
- Why does remote __get_specific use the raw serializer and not the objects from memory?
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
prototype webui search with pagination
by Vreman, Peter
Currently the webui search does not work because it misses required values for the paging. Also paging is not supported so a query for '*' can generate a huge list.
Attached is a prototype that adds also paging to the webui search for the distro's.
What it does:
- All paging is done in remote API
- Remote API Find method will include paging functionality.
- WebUI list also uses the remote API find function with empty criteria
- WebUI search will only show the criteria builder, the search will be done by the list page
- Add a $pageinfo$ item to the find results list. This contains the paging information about the returned list. This item needs to be stripped by the WUI/TUI
Possible improvements:
- For securitie save search criteria dictionary in a cache instead of passing them as string on the http request. Benefit is that saving search criteria to disk can also be implemented
Please provide feedback if this is a good approach.
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
[PATCH] Break up reporting functions by "collection" and by "item"
by Adam Rosenwald
As per discussion on IRC #cobbler today. I noticed that individual item
(as opposed to collections of 'systems', 'profiles', etc.) reporting is
broken. The patch (below) creates two additional functions for
item-based reporting: one printing 'all fields' and one printing 'some
fields'. The program logic has been adjusted and the original
(collection) function names have been modified.
FYI,
- A.
---
From 999a6b1b87206f68bf127f5479b74c4279a370f7 Mon Sep 17 00:00:00 2001
From: ARos <aros(a)linkshare.com>
Date: Sat, 28 Mar 2009 00:01:27 +0000
Subject: [PATCH] Break up reporting functions by "collection" and by "item".
- Adam R.
---
cobbler/action_report.py | 98
+++++++++++++++++++++++++++++++++++++++-------
1 files changed, 84 insertions(+), 14 deletions(-)
diff --git a/cobbler/action_report.py b/cobbler/action_report.py
index 2288433..f24bb9f 100644
--- a/cobbler/action_report.py
+++ b/cobbler/action_report.py
@@ -213,7 +213,7 @@ class Report:
print obj.printable()
return True
- def reporting_print_all_fields(self, collection, report_type,
report_noheaders):
+ def reporting_print_all_fields_collection(self, collection,
report_type, report_noheaders):
"""
Prints all fields in a collection as a table given the report type
"""
@@ -250,7 +250,41 @@ class Report:
return True
- def reporting_print_x_fields(self, collection, report_type,
report_fields, report_noheaders):
+ def reporting_print_all_fields_item(self, item, report_type,
report_noheaders):
+ """
+ Prints all fields for an item as a table given the report type
+ """
+ data = []
+ out_order = []
+ count = 0
+ x = {}
+ structure = item.to_datastruct()
+
+ for (key, value) in structure.iteritems():
+
+ # exception for systems which could have > 1 interface
+ if key == "interfaces":
+ for (device, info) in value.iteritems():
+ for (info_header, info_value) in info.iteritems():
+ x[info_header] = str(device) + ': ' +
str(info_value)
+ # needs to create order list for
print_formatted_fields
+ if count == 0:
+ out_order.append(info_header)
+ else:
+ x[key] = value
+ # needs to create order list for print_formatted_fields
+ if count == 0:
+ out_order.append(key)
+
+ count = count + 1
+
+ data.append(x)
+
+ self.print_formatted_data(data = data, order = out_order,
report_type = report_type, noheaders = report_noheaders)
+
+ return True
+
+ def reporting_print_x_fields_collection(self, collection,
report_type, report_fields, report_noheaders):
"""
Prints specific fields in a collection as a table given the
report type
"""
@@ -281,6 +315,34 @@ class Report:
return True
+ def reporting_print_x_fields_item(self, item, report_type,
report_fields, report_noheaders):
+ """
+ Prints specific fields for an item as a table given the report type
+ """
+ data = []
+ fields_list = report_fields.replace(' ', '').split(',')
+
+ structure = item.to_datastruct()
+ x = {}
+ for field in fields_list:
+
+ if field in structure.keys():
+ x[field] = structure[field]
+
+ # exception for systems which could have > 1 interface
+ elif "interfaces" in structure.keys():
+ for device in structure['interfaces'].keys():
+ if field in structure['interfaces'][device]:
+ x[field] = device + ': ' +
structure['interfaces'][device][field]
+ else:
+ raise CX(_("The field %s does not exist, see cobbler
dumpvars for available fields.") % field)
+
+ data.append(x)
+
+ self.print_formatted_data(data = data, order = fields_list,
report_type = report_type, noheaders = report_noheaders)
+
+ return True
+
# -------------------------------------------------------
def run(self, report_what = None, report_name = None, report_type =
None, report_fields = None, report_noheaders = None):
@@ -330,36 +392,44 @@ class Report:
elif report_type == 'text' and report_fields != 'all':
raise CX(_("The 'text' type can only be used with field set
to 'all'"))
- elif report_type != 'text' and report_fields == 'all':
+ # for a collection
+ elif report_type != 'text' and report_fields == 'all' and
report_what:
if report_what in [ "all", "distros", "distro" ]:
- self.reporting_print_all_fields(self.api.distros(),
report_type, report_noheaders)
+
self.reporting_print_all_fields_collection(self.api.distros(),
report_type, report_noheaders)
if report_what in [ "all", "profiles", "profile" ]:
- self.reporting_print_all_fields(self.api.profiles(),
report_type, report_noheaders)
+
self.reporting_print_all_fields_collection(self.api.profiles(),
report_type, report_noheaders)
if report_what in [ "all", "systems", "system" ]:
- self.reporting_print_all_fields(self.api.systems(),
report_type, report_noheaders)
+
self.reporting_print_all_fields_collection(self.api.systems(),
report_type, report_noheaders)
if report_what in [ "all", "repos", "repo" ]:
- self.reporting_print_all_fields(self.api.repos(),
report_type, report_noheaders)
+
self.reporting_print_all_fields_collection(self.api.repos(),
report_type, report_noheaders)
if report_what in [ "all", "images", "image" ]:
- self.reporting_print_all_fields(self.api.images(),
report_type, report_noheaders)
+
self.reporting_print_all_fields_collection(self.api.images(),
report_type, report_noheaders)
- else:
+ # for an item
+ elif report_type != 'text' and report_fields == 'all':
+
+ self.reporting_print_all_fields_item(report_name,
report_type, report_noheaders)
+
+ elif report_what:
if report_what in [ "all", "distros", "distro" ]:
- self.reporting_print_x_fields(self.api.distros(),
report_type, report_fields, report_noheaders)
+
self.reporting_print_x_fields_collection(self.api.distros(),
report_type, report_fields, report_noheaders)
if report_what in [ "all", "profiles", "profile" ]:
- self.reporting_print_x_fields(self.api.profiles(),
report_type, report_fields, report_noheaders)
+
self.reporting_print_x_fields_collection(self.api.profiles(),
report_type, report_fields, report_noheaders)
if report_what in [ "all", "systems", "system" ]:
- self.reporting_print_x_fields(self.api.systems(),
report_type, report_fields, report_noheaders)
+
self.reporting_print_x_fields_collection(self.api.systems(),
report_type, report_fields, report_noheaders)
if report_what in [ "all", "repos", "repo" ]:
- self.reporting_print_x_fields(self.api.repos(),
report_type, report_fields, report_noheaders)
+
self.reporting_print_x_fields_collection(self.api.repos(), report_type,
report_fields, report_noheaders)
if report_what in [ "all", "images", "image" ]:
- self.reporting_print_x_fields(self.api.images(),
report_type, report_fields, report_noheaders)
+
self.reporting_print_x_fields_collection(self.api.images(), report_type,
report_fields, report_noheaders)
+ else:
+ self.reporting_print_x_fields_item(report_name,
report_type, report_fields, report_noheaders)
--
1.5.5.1
15 years
[PATCH] Modification to --in-place functions to allow deletion of single (or multiple) items
by James Cammarata
Preceding the key value with '~' causes the key=value pair to be deleted
(only when --in-place is specified), as shown below:
$ cobbler system report | grep metadata
ks metadata : {}
$ cobbler system report --name=test | grep metadata
ks metadata : {}
$ cobbler system edit --name=test --in-place --ksmeta='a=b'
$ cobbler system report --name=test | grep metadata
ks metadata : {'a': 'b'}
$ cobbler system edit --name=test --in-place --ksmeta='~a'
$ cobbler system report --name=test | grep metadata
ks metadata : {}
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
15 years