Branch 'devel' - cas.spec
by Adam Stokes
cas.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit def6e9156781579835fe523df1812825703e7d28
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Tue May 4 15:28:27 2010 -0400
fix requires in section of cas
diff --git a/cas.spec b/cas.spec
index d66abe4..b51638c 100644
--- a/cas.spec
+++ b/cas.spec
@@ -40,7 +40,7 @@ the database instance with newly added kernel debug information and timestamps.
Summary: Web frontend to CAS
Group: Applications/System
Requires: cas = %{version}-%{release}
-Requires: admin = %{version}-%{release}
+Requires: cas-admin = %{version}-%{release}
%description server
Provides web frontend to CAS to allow for a much simpler user experience when
14 years
Branch 'devel' - cas caslib/cas.py cas.spec doc/genindex.html doc/index.html doc/index.rst doc/objects.inv doc/search.html doc/searchindex.js doc/_sources doc/_static man/en
by Adam Stokes
cas | 33 +++++++++++++++++----------------
cas.spec | 1 +
caslib/cas.py | 16 +++++++++-------
doc/_sources/index.txt | 25 +++++++++++++------------
doc/_static/basic.css | 14 +++++++++++++-
doc/_static/default.css | 20 ++++++++++++++++++++
doc/genindex.html | 20 ++++++++++----------
doc/index.html | 47 ++++++++++++++++++++++++-----------------------
doc/index.rst | 26 ++++++++++++++------------
doc/objects.inv | 2 +-
doc/search.html | 16 ++++++++--------
doc/searchindex.js | 2 +-
man/en/cas-admin.1 | 7 ++-----
man/en/cas.1 | 8 +++++++-
14 files changed, 140 insertions(+), 97 deletions(-)
New commits:
commit e3ee0882c260634b3e84681d9b23edaa1a89c07a
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Tue May 4 15:27:37 2010 -0400
doc update; man page update
diff --git a/cas b/cas
index 48bf09a..b5d3537 100755
--- a/cas
+++ b/cas
@@ -1,26 +1,27 @@
#!/usr/bin/python
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# cas
+# cas cmd line interface
+# Copyright (C) 2010 Adam Stokes
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" cas - core accessibility system.
"""
-from caslib.cas import *
+from caslib.cas import CasApplication
import os
if __name__=="__main__":
- # Before we start the database has to exist.
- if not os.path.isfile(settings["DATABASE"]):
- raise SystemExit("No Database exist, please run cas-admin --help for more information.")
# Begin CAS
app = CasApplication(sys.argv[1:])
sys.exit(app.run())
diff --git a/cas.spec b/cas.spec
index 3766612..d66abe4 100644
--- a/cas.spec
+++ b/cas.spec
@@ -40,6 +40,7 @@ the database instance with newly added kernel debug information and timestamps.
Summary: Web frontend to CAS
Group: Applications/System
Requires: cas = %{version}-%{release}
+Requires: admin = %{version}-%{release}
%description server
Provides web frontend to CAS to allow for a much simpler user experience when
diff --git a/caslib/cas.py b/caslib/cas.py
index 777cf53..9bd4897 100755
--- a/caslib/cas.py
+++ b/caslib/cas.py
@@ -139,7 +139,7 @@ class CasApplication(object):
parser.add_option("-m","--modules", dest="kernel_modules",
help="Extract associated kernel modules",
action="store_true")
- parser.add_option("-c","--compress", dest="compress_core",
+ parser.add_option("--compress", dest="compress_core",
help="Helper option to compress core to be transferred "\
"to another destination.", action="store_true")
parser.add_option("--strip", dest="strip_core",
@@ -150,8 +150,11 @@ class CasApplication(object):
self.opts, args = parser.parse_args()
+ # filename _must_ exist
if not self.opts.filename:
parser.error("A file object is missing.")
+ else:
+ self.filename = self.opts.filename
# check if we want to strip the core
if self.opts.strip_core:
@@ -164,6 +167,11 @@ class CasApplication(object):
if err:
return _e[8]
+ # Not compressing lets continue with validating a identifier
+ if not self.opts.identifier:
+ parser.error("A unique identifier number is missing.")
+ else:
+ self.identifier = self.opts.identifier
# Add job to database, this allows us to purge
# data based on job date creation then by other
# means. (i.e. identifier == a bugzilla #)
@@ -178,12 +186,6 @@ class CasApplication(object):
if not self.job_record:
return _e[40]
- # Not compressing lets continue with validating a identifier
- if not self.opts.identifier:
- parser.error("A unique identifier number is missing.")
-
- self.filename = self.opts.filename
- self.identifier = self.opts.identifier
self.email = self.opts.email
self.extractKernelModules = self.opts.kernel_modules
# we want to allow for multiple cores under same identifier
diff --git a/doc/_sources/index.txt b/doc/_sources/index.txt
index 9a394e8..1a0fdb9 100644
--- a/doc/_sources/index.txt
+++ b/doc/_sources/index.txt
@@ -30,6 +30,12 @@ Fedora 9 or later (this would include RHEL 5) the EPEL repo needs to be
installed. Visit `EPEL <https://fedoraproject.org/wiki/EPEL>`_ to enable
this repository.
+Other package requirements:
+- python-urlgrabber
+- python-sqlalchemy
+- python-cherrypy
+- python-simplejson
+
The amount of storage needed can be determined base on the following
information:
@@ -119,7 +125,7 @@ Preparing CAS Server
To install the CAS package simply type::
- $ yum install cas
+ $ yum install cas-server
Once installed edit ``/etc/cas.conf`` as root using any preferred text editor.
As described above the required directives need to be altered to suit the
@@ -163,7 +169,7 @@ Running CAS
First, one or two administrative tasks need to be run. The required task is to build
a database for all the data gathered from the kernel-debuginfo packages.::
- $ cas-admin -b
+ $ cas-admin
If several systems are deployed for CAS to use, ssh keys must be setup between the host (CAS) and
the clients::
@@ -174,7 +180,7 @@ the clients::
Once ssh has been setup between systems the following will build the server database::
- $ cas-admin -s
+ $ cas-admin --server
Please note that in order for cas to function properly it is required that only the cas
user on the system has only those entries in its ssh hostkey file that are accessible
@@ -195,7 +201,8 @@ a few options to pass::
-e EMAIL, --email=EMAIL
Define email for results (must be valid!)
-m, --modules Extract associated kernel modules
- -c, --compress Compress file for transfer to another destination
+ --compress Compress file for transfer to another destination
+ --strip Strips unnecessary kernel pages
CAS prepares its directory hierarchy based on the ``identifier`` this option is
therefore required. ``filename`` is also required as it tells CAS exactly which
@@ -227,17 +234,11 @@ initial analysis to the specified email address. From there further instructions
are provided in either the email or the ``process log`` on how to access and analyze
the core.
-CAS also provides an option to compress a file using ``pbzip2`` which will utilize
-the systems cpu's in order to eliminate a lot of the wait it takes to compress/decompress
-a core file.
+CAS also provides an option to compress a file using ``xz``
To use simply type::
- $ cas -f vmcore -c
-
-The benefit of using ``pbzip2`` for compression is that it will decompress utilizing the
-systems cpu's as well. This option is preferred since the downtime is cut in half of what
-it would take using the normal single cpu bound ``bzip2``.
+ $ cas -f vmcore --compress
Analyzing
---------
diff --git a/doc/_static/basic.css b/doc/_static/basic.css
index 128114b..a04d654 100644
--- a/doc/_static/basic.css
+++ b/doc/_static/basic.css
@@ -332,6 +332,18 @@ dl.glossary dt {
background-color: #ffa
}
+.line-block {
+ display: block;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.line-block .line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
+
/* -- code displays --------------------------------------------------------- */
pre {
@@ -392,7 +404,7 @@ span.eqno {
div.document,
div.documentwrapper,
div.bodywrapper {
- margin: 0;
+ margin: 0 !important;
width: 100%;
}
diff --git a/doc/_static/default.css b/doc/_static/default.css
index c999f67..3725744 100644
--- a/doc/_static/default.css
+++ b/doc/_static/default.css
@@ -166,6 +166,18 @@ div.admonition p.admonition-title + p {
display: inline;
}
+div.admonition p {
+ margin-bottom: 5px;
+}
+
+div.admonition pre {
+ margin-bottom: 5px;
+}
+
+div.admonition ul, div.admonition ol {
+ margin-bottom: 5px;
+}
+
div.note {
background-color: #eee;
border: 1px solid #ccc;
@@ -207,4 +219,12 @@ tt {
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 0.95em;
+}
+
+.warning tt {
+ background: #efc2c2;
+}
+
+.note tt {
+ background: #d6d6d6;
}
\ No newline at end of file
diff --git a/doc/genindex.html b/doc/genindex.html
index b891687..e5987d5 100644
--- a/doc/genindex.html
+++ b/doc/genindex.html
@@ -5,13 +5,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Index — CAS v0.15 documentation</title>
+ <title>Index — CAS v1.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '',
- VERSION: '0.15',
+ URL_ROOT: '#',
+ VERSION: '1.0',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@@ -19,16 +19,16 @@
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
- <link rel="top" title="CAS v0.15 documentation" href="index.html" />
+ <link rel="top" title="CAS v1.0 documentation" href="index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
- <a href="" title="General Index"
+ <a href="#" title="General Index"
accesskey="I">index</a></li>
- <li><a href="index.html">CAS v0.15 documentation</a> »</li>
+ <li><a href="index.html">CAS v1.0 documentation</a> »</li>
</ul>
</div>
@@ -76,14 +76,14 @@
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
- <a href="" title="General Index"
+ <a href="#" title="General Index"
>index</a></li>
- <li><a href="index.html">CAS v0.15 documentation</a> »</li>
+ <li><a href="index.html">CAS v1.0 documentation</a> »</li>
</ul>
</div>
<div class="footer">
- © Copyright 2009, Adam Stokes.
- Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
+ © Copyright 2010, Adam Stokes.
+ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.5.
</div>
</body>
</html>
\ No newline at end of file
diff --git a/doc/index.html b/doc/index.html
index f8fe181..1837648 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -5,13 +5,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Core Analysis System — CAS v0.15 documentation</title>
+ <title>Core Analysis System — CAS v1.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '',
- VERSION: '0.15',
+ URL_ROOT: '#',
+ VERSION: '1.0',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@@ -19,7 +19,7 @@
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
- <link rel="top" title="CAS v0.15 documentation" href="" />
+ <link rel="top" title="CAS v1.0 documentation" href="#" />
</head>
<body>
<div class="related">
@@ -28,7 +28,7 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
- <li><a href="">CAS v0.15 documentation</a> »</li>
+ <li><a href="#">CAS v1.0 documentation</a> »</li>
</ul>
</div>
@@ -45,9 +45,9 @@
<tbody valign="top">
<tr class="field"><th class="field-name">Author:</th><td class="field-body">Adam Stokes</td>
</tr>
-<tr class="field"><th class="field-name">Release:</th><td class="field-body">0.15</td>
+<tr class="field"><th class="field-name">Release:</th><td class="field-body">1.0</td>
</tr>
-<tr class="field"><th class="field-name">Date:</th><td class="field-body">December 09, 2009</td>
+<tr class="field"><th class="field-name">Date:</th><td class="field-body">May 04, 2010</td>
</tr>
</tbody>
</table>
@@ -66,6 +66,11 @@ types to core dumps are automatically detected and processed.</p>
Fedora 9 or later (this would include RHEL 5) the EPEL repo needs to be
installed. Visit <a class="reference external" href="https://fedoraproject.org/wiki/EPEL">EPEL</a> to enable
this repository.</p>
+<p>Other package requirements:
+- python-urlgrabber
+- python-sqlalchemy
+- python-cherrypy
+- python-simplejson</p>
<p>The amount of storage needed can be determined base on the following
information:</p>
<ul class="simple">
@@ -138,7 +143,7 @@ fine.</p>
<div class="section" id="preparing-cas-server">
<h3>Preparing CAS Server<a class="headerlink" href="#preparing-cas-server" title="Permalink to this headline">¶</a></h3>
<p>To install the CAS package simply type:</p>
-<div class="highlight-python"><pre>$ yum install cas</pre>
+<div class="highlight-python"><pre>$ yum install cas-server</pre>
</div>
<p>Once installed edit <tt class="docutils literal"><span class="pre">/etc/cas.conf</span></tt> as root using any preferred text editor.
As described above the required directives need to be altered to suit the
@@ -177,7 +182,7 @@ with kernel-debuginfo rpm’s the next section will describe running CAS.</p
<h3>Running CAS<a class="headerlink" href="#running-cas" title="Permalink to this headline">¶</a></h3>
<p>First, one or two administrative tasks need to be run. The required task is to build
a database for all the data gathered from the kernel-debuginfo packages.:</p>
-<div class="highlight-python"><pre>$ cas-admin -b</pre>
+<div class="highlight-python"><pre>$ cas-admin</pre>
</div>
<p>If several systems are deployed for CAS to use, ssh keys must be setup between the host (CAS) and
the clients:</p>
@@ -186,7 +191,7 @@ Cas supports passwordless entries at this time.
(cas-server) $ ssh-copy-id -i ~/.ssh/id_dsa casuser(a)cas-client-system.com</pre>
</div>
<p>Once ssh has been setup between systems the following will build the server database:</p>
-<div class="highlight-python"><pre>$ cas-admin -s</pre>
+<div class="highlight-python"><pre>$ cas-admin --server</pre>
</div>
<p>Please note that in order for cas to function properly it is required that only the cas
user on the system has only those entries in its ssh hostkey file that are accessible
@@ -205,7 +210,8 @@ Options:
-e EMAIL, --email=EMAIL
Define email for results (must be valid!)
-m, --modules Extract associated kernel modules
- -c, --compress Compress file for transfer to another destination</pre>
+ --compress Compress file for transfer to another destination
+ --strip Strips unnecessary kernel pages</pre>
</div>
<p>CAS prepares its directory hierarchy based on the <tt class="docutils literal"><span class="pre">identifier</span></tt> this option is
therefore required. <tt class="docutils literal"><span class="pre">filename</span></tt> is also required as it tells CAS exactly which
@@ -231,15 +237,10 @@ useful when analyzing filesystem issues and the like.</p>
initial analysis to the specified email address. From there further instructions
are provided in either the email or the <tt class="docutils literal"><span class="pre">process</span> <span class="pre">log</span></tt> on how to access and analyze
the core.</p>
-<p>CAS also provides an option to compress a file using <tt class="docutils literal"><span class="pre">pbzip2</span></tt> which will utilize
-the systems cpu’s in order to eliminate a lot of the wait it takes to compress/decompress
-a core file.</p>
+<p>CAS also provides an option to compress a file using <tt class="docutils literal"><span class="pre">xz</span></tt></p>
<p>To use simply type:</p>
-<div class="highlight-python"><pre>$ cas -f vmcore -c</pre>
+<div class="highlight-python"><pre>$ cas -f vmcore --compress</pre>
</div>
-<p>The benefit of using <tt class="docutils literal"><span class="pre">pbzip2</span></tt> for compression is that it will decompress utilizing the
-systems cpu’s as well. This option is preferred since the downtime is cut in half of what
-it would take using the normal single cpu bound <tt class="docutils literal"><span class="pre">bzip2</span></tt>.</p>
</div>
</div>
<div class="section" id="analyzing">
@@ -390,9 +391,9 @@ no errors.</p>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
- <h3><a href="">Table Of Contents</a></h3>
+ <h3><a href="#">Table Of Contents</a></h3>
<ul>
-<li><a class="reference external" href="">Core Analysis System</a><ul>
+<li><a class="reference external" href="#">Core Analysis System</a><ul>
<li><a class="reference external" href="#introduction">Introduction</a><ul>
<li><a class="reference external" href="#description">Description</a></li>
<li><a class="reference external" href="#prerequisites">Prerequisites</a></li>
@@ -439,12 +440,12 @@ no errors.</p>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
- <li><a href="">CAS v0.15 documentation</a> »</li>
+ <li><a href="#">CAS v1.0 documentation</a> »</li>
</ul>
</div>
<div class="footer">
- © Copyright 2009, Adam Stokes.
- Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
+ © Copyright 2010, Adam Stokes.
+ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.5.
</div>
</body>
</html>
\ No newline at end of file
diff --git a/doc/index.rst b/doc/index.rst
index 9a394e8..7a1c955 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -30,6 +30,12 @@ Fedora 9 or later (this would include RHEL 5) the EPEL repo needs to be
installed. Visit `EPEL <https://fedoraproject.org/wiki/EPEL>`_ to enable
this repository.
+Other package requirements:
+- python-urlgrabber
+- python-sqlalchemy
+- python-cherrypy
+- python-simplejson
+
The amount of storage needed can be determined base on the following
information:
@@ -119,7 +125,7 @@ Preparing CAS Server
To install the CAS package simply type::
- $ yum install cas
+ $ yum install cas-server
Once installed edit ``/etc/cas.conf`` as root using any preferred text editor.
As described above the required directives need to be altered to suit the
@@ -163,7 +169,7 @@ Running CAS
First, one or two administrative tasks need to be run. The required task is to build
a database for all the data gathered from the kernel-debuginfo packages.::
- $ cas-admin -b
+ $ cas-admin
If several systems are deployed for CAS to use, ssh keys must be setup between the host (CAS) and
the clients::
@@ -174,7 +180,7 @@ the clients::
Once ssh has been setup between systems the following will build the server database::
- $ cas-admin -s
+ $ cas-admin --server
Please note that in order for cas to function properly it is required that only the cas
user on the system has only those entries in its ssh hostkey file that are accessible
@@ -195,7 +201,9 @@ a few options to pass::
-e EMAIL, --email=EMAIL
Define email for results (must be valid!)
-m, --modules Extract associated kernel modules
- -c, --compress Compress file for transfer to another destination
+ --compress Compress file for transfer to another destination
+ --strip Strips unnecessary kernel pages
+ --job=JOB Attach to an existing job
CAS prepares its directory hierarchy based on the ``identifier`` this option is
therefore required. ``filename`` is also required as it tells CAS exactly which
@@ -227,17 +235,11 @@ initial analysis to the specified email address. From there further instructions
are provided in either the email or the ``process log`` on how to access and analyze
the core.
-CAS also provides an option to compress a file using ``pbzip2`` which will utilize
-the systems cpu's in order to eliminate a lot of the wait it takes to compress/decompress
-a core file.
+CAS also provides an option to compress a file using ``xz``
To use simply type::
- $ cas -f vmcore -c
-
-The benefit of using ``pbzip2`` for compression is that it will decompress utilizing the
-systems cpu's as well. This option is preferred since the downtime is cut in half of what
-it would take using the normal single cpu bound ``bzip2``.
+ $ cas -f vmcore --compress
Analyzing
---------
diff --git a/doc/objects.inv b/doc/objects.inv
index a1c1ea1..0540417 100644
--- a/doc/objects.inv
+++ b/doc/objects.inv
@@ -1,3 +1,3 @@
# Sphinx inventory version 1
# Project: CAS
-# Version: 0.15
+# Version: 1.0
diff --git a/doc/search.html b/doc/search.html
index 6752a0d..228ae2b 100644
--- a/doc/search.html
+++ b/doc/search.html
@@ -5,13 +5,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Search — CAS v0.15 documentation</title>
+ <title>Search — CAS v1.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '',
- VERSION: '0.15',
+ URL_ROOT: '#',
+ VERSION: '1.0',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@@ -20,7 +20,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script>
- <link rel="top" title="CAS v0.15 documentation" href="index.html" />
+ <link rel="top" title="CAS v1.0 documentation" href="index.html" />
</head>
<body>
<div class="related">
@@ -29,7 +29,7 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
- <li><a href="index.html">CAS v0.15 documentation</a> »</li>
+ <li><a href="index.html">CAS v1.0 documentation</a> »</li>
</ul>
</div>
@@ -77,13 +77,13 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
- <li><a href="index.html">CAS v0.15 documentation</a> »</li>
+ <li><a href="index.html">CAS v1.0 documentation</a> »</li>
</ul>
</div>
<div class="footer">
- © Copyright 2009, Adam Stokes.
- Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
+ © Copyright 2010, Adam Stokes.
+ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.5.
</div>
<script type="text/javascript" src="searchindex.js"></script>
diff --git a/doc/searchindex.js b/doc/searchindex.js
index 746faa2..dc8cce5 100644
--- a/doc/searchindex.js
+++ b/doc/searchindex.js
@@ -1 +1 @@
-Search.setIndex({desctypes:{},terms:{all:0,mnt:0,ffffffff8011d191:0,snip:0,abil:0,follow:0,disk:0,depend:0,do_dlm_lock:0,ffffffff80110bf5:0,those:0,downtim:0,worth:0,sent:0,r14:0,r15:0,r12:0,r13:0,r10:0,r11:0,faq:0,util:0,ffffffff8010e789:0,vmcore:0,upstream:0,ticket:0,relev:0,administr:0,level:0,die:0,list:0,prepar:0,pleas:0,x86_64:0,intial:0,direct:0,pass:0,download:0,further:0,rbp:0,what:0,sub:0,section:0,abl:0,access:0,version:0,hostkei:0,elimin:0,autogener:0,gener:0,here:0,pbzip2:0,address:0,path:0,sinc:0,valu:0,wait:0,rdx:0,amount:0,typic:0,rdi:0,smp_call_function_interrupt:0,chanc:0,"0000010001073f48":0,prerequisit:0,modul:0,prefer:0,crash_32:0,filenam:0,id_dsa:0,instal:0,from:0,describ:0,would:0,prove:0,doubl:0,visit:0,two:0,next:0,few:0,usr:0,recommend:0,type:0,tell:0,more:0,sort:0,wrapper:0,share:0,ffffffff803e9b80:0,"1tb":0,aris:0,must:0,none:0,retriev:0,hous:0,setup:0,work:0,uniqu:0,can:0,root:0,sqlite:0,tar:0,process:0,smtp:0,accept:0,want:0,occur:0,multipl:0,anoth:0,snippet:0,how:0,error_exit:0,purg:0,verifi:0,negoti:0,perspect:0,ffffffff80528000:0,resourc:0,passwordless:0,"00000102000a4780":0,clone:0,reflect:0,date:0,associ:0,physic:0,essenti:0,issu:0,inform:0,environ:0,media:0,order:0,help:0,over:0,major:0,i386:0,hierarchi:0,paramet:0,"100f57cb030":0,ellargesmp:0,bin:0,mail:0,main:0,alter:0,crash:0,thei:0,python:0,auto:0,overal:0,dai:0,initi:0,"break":0,mention:0,half:0,itanium:0,now:0,introduct:0,name:0,edit:0,troubleshoot:0,authent:0,kern:0,each:0,debug:0,mean:0,mai:0,continu:0,happen:0,extract:0,buffers:0,out:0,shown:0,network:0,ffffffff8014cc1d:0,dss:0,content:0,fffffffffffffffa:0,dsa:0,advanc:0,orig_rax:0,given:0,base:0,releas:0,org:0,ffffffff80110e1d:0,traceback:0,keep:0,vmlinux:0,thing:0,yum:0,isn:0,assign:0,first:0,origin:0,rang:0,onc:0,number:0,swapper:0,instruct:0,done:0,least:0,rflag:0,differ:0,script:0,data:0,interact:0,system:0,messag:0,ffffffff80112058:0,statement:0,ffffffff8047a0a0:0,"final":0,store:0,includ:0,option:0,debuginfo:0,tool:0,copi:0,specifi:0,"var":0,checkout:0,exactli:0,rsp:0,than:0,provid:0,see:0,structur:0,boil:0,stale:0,analysi:0,ani:0,fail:0,have:0,need:0,"101f3658030":0,rax:0,rsi:0,packag:0,engin:0,bz2:0,lib:0,note:0,also:0,exampl:0,take:0,which:0,singl:0,begin:0,normal:0,buffer:0,who:0,compress:0,most:0,regular:0,deploi:0,"101f21efb80":0,gather:0,place:0,determin:0,irq:0,latest:0,show:0,text:0,fine:0,find:0,current:0,onli:0,locat:0,configur:0,solut:0,state:0,should:0,analyz:0,local:0,variou:0,cvjf:0,express:0,autom:0,repo:0,mainten:0,ssh:0,requir:0,enabl:0,organ:0,cleanli:0,contain:0,where:0,wiki:0,kernel:0,set:0,dump:0,"10001073f48":0,emac:0,result:0,arg:0,corrupt:0,subject:0,ffffffffa03183ff:0,detect:0,purgelimit:0,extend:0,databas:0,someth:0,enough:0,between:0,approach:0,email:0,altern:0,assumpt:0,kei:0,cpu_idl:0,default_idl:0,job:0,cut:0,come:0,tue:0,addit:0,last:0,admin:0,fault:0,etc:0,instanc:0,mani:0,com:0,improp:0,load:0,simpli:0,point:0,"1000107bfb0":0,rpm:0,casus:0,coredump:0,been:0,mark:0,much:0,sshkei:0,popul:0,quickli:0,largesmp:0,anywher:0,try_crashdump:0,"0000000000000e86":0,present:0,therefor:0,look:0,rbx:0,solid:0,mount:0,keygen:0,defin:0,abov:0,error:0,"101f21efb20":0,ffffffff8047a0b0:0,timefram:0,rip:0,destin:0,call_function_interrupt:0,archiv:0,uncom:0,conf:0,fedorahost:0,sever:0,fedora:0,author:0,suggest:0,same:0,binari:0,timestamp:0,x86:0,someon:0,decompress:0,temporari:0,user:0,"500gb":0,stack:0,task:0,"10001073e98":0,entri:0,do_invalid_op:0,well:0,client:0,command:0,thi:0,filesystem:0,gzip:0,everyth:0,usual:0,identifi:0,execut:0,workdirectori:0,heavili:0,previous:0,samba:0,except:0,other:0,match:0,build:0,opt:0,read:0,kmem:0,debuglevel:0,smtphost:0,mod:0,"1000107bfa0":0,resid:0,like:0,specif:0,anyon:0,manual:0,resolv:0,server:0,collect:0,benefit:0,necessari:0,either:0,"101f21efb60":0,"101f21efc40":0,output:0,some:0,back:0,gfs_quotad:0,proper:0,tmp:0,assum:0,ffffffff80529f08:0,exit:0,machin:0,core:0,previou:0,run:0,reach:0,usag:0,host:0,repositori:0,memori:0,unfortun:0,primarili:0,within:0,bound:0,automat:0,down:0,"101f21efb50":0,chang:0,start_disk_dump:0,storag:0,git:0,rcx:0,log:0,wai:0,area:0,transfer:0,support:0,question:0,avail:0,editor:0,lot:0,suit:0,hassl:0,rhel:0,"function":0,properli:0,form:0,pwd:0,line:0,analyst:0,info:0,commun:0,made:0,possibl:0,"default":0,wish:0,below:0,ffffffff80111c90:0,otherwis:0,problem:0,similar:0,epel:0,later:0,certain:0,dure:0,pid:0,incomplet:0,exist:0,file:0,cvzf:0,fill:0,bzip2:0,"00000100f57cb030":0,when:0,valid:0,ffffffff8010e7a9:0,architectur:0,corefil:0,benefici:0,autopurg:0,ffffffff80529fb8:0,stoke:0,directori:0,descript:0,adam:0,time:0,ffffffff8010e81c:0,decemb:0,rpmfilter:0,cpu:0},titles:["Core Analysis System"],modules:{},descrefs:{},filenames:["index"]})
\ No newline at end of file
+Search.setIndex({desctypes:{},terms:{all:0,mnt:0,ffffffff8011d191:0,snip:0,abil:0,follow:0,disk:0,depend:0,wish:0,do_dlm_lock:0,those:0,aris:0,worth:0,sent:0,r14:0,r15:0,r12:0,r13:0,r10:0,r11:0,faq:0,ffffffff8010e789:0,vmcore:0,upstream:0,ticket:0,relev:0,administr:0,level:0,die:0,list:0,form:0,prepar:0,pleas:0,x86_64:0,core:0,direct:0,pass:0,download:0,further:0,keygen:0,sub:0,section:0,abl:0,access:0,version:0,hostkei:0,autogener:0,gener:0,here:0,address:0,path:0,sinc:0,valu:0,ffffffff80110bf5:0,rdx:0,amount:0,typic:0,rdi:0,smp_call_function_interrupt:0,chanc:0,"0000010001073f48":0,repositori:0,modul:0,prefer:0,crash_32:0,filenam:0,id_dsa:0,instal:0,from:0,describ:0,would:0,memori:0,doubl:0,visit:0,two:0,next:0,few:0,usr:0,recommend:0,type:0,tell:0,more:0,sort:0,wrapper:0,share:0,ffffffff803e9b80:0,"1tb":0,must:0,none:0,retriev:0,hous:0,setup:0,work:0,uniqu:0,can:0,root:0,sqlite:0,conf:0,tar:0,process:0,smtp:0,accept:0,want:0,occur:0,multipl:0,anoth:0,snippet:0,how:0,error_exit:0,purg:0,opt:0,verifi:0,negoti:0,perspect:0,ffffffff80528000:0,resourc:0,passwordless:0,"00000102000a4780":0,clone:0,reflect:0,date:0,data:0,physic:0,essenti:0,issu:0,inform:0,environ:0,suggest:0,order:0,help:0,over:0,major:0,i386:0,hierarchi:0,paramet:0,"100f57cb030":0,requir:0,mail:0,main:0,alter:0,crash:0,thei:0,python:0,auto:0,overal:0,dai:0,initi:0,"break":0,mention:0,itanium:0,now:0,introduct:0,name:0,edit:0,troubleshoot:0,authent:0,kern:0,each:0,debug:0,mean:0,mai:0,continu:0,happen:0,extract:0,buffers:0,out:0,shown:0,network:0,ffffffff8014cc1d:0,dss:0,content:0,fffffffffffffffa:0,dsa:0,advanc:0,orig_rax:0,given:0,base:0,releas:0,org:0,ffffffff80110e1d:0,traceback:0,keep:0,vmlinux:0,thing:0,yum:0,isn:0,assign:0,first:0,origin:0,rang:0,onc:0,number:0,swapper:0,instruct:0,done:0,least:0,rflag:0,differ:0,script:0,associ:0,interact:0,system:0,messag:0,ffffffff80112058:0,statement:0,ffffffff8047a0a0:0,"final":0,boil:0,editor:0,option:0,debuginfo:0,tool:0,copi:0,specifi:0,hassl:0,exactli:0,rsp:0,than:0,provid:0,urlgrabb:0,emac:0,structur:0,store:0,stale:0,"function":0,ani:0,packag:0,have:0,need:0,"101f3658030":0,rax:0,rsi:0,engin:0,bz2:0,lib:0,note:0,also:0,client:0,build:0,which:0,begin:0,normal:0,buffer:0,previou:0,compress:0,most:0,regular:0,deploi:0,everyth:0,prove:0,"101f21efb80":0,gather:0,place:0,determin:0,databas:0,usual:0,show:0,text:0,fine:0,find:0,current:0,onli:0,locat:0,configur:0,solut:0,state:0,should:0,analyz:0,local:0,variou:0,cvjf:0,express:0,autom:0,repo:0,mainten:0,ssh:0,ellargesmp:0,enabl:0,organ:0,cleanli:0,contain:0,where:0,wiki:0,kernel:0,set:0,dump:0,"10001073f48":0,see:0,result:0,arg:0,corrupt:0,subject:0,ffffffffa03183ff:0,detect:0,purgelimit:0,extend:0,irq:0,someth:0,enough:0,between:0,approach:0,email:0,altern:0,assumpt:0,kei:0,cpu_idl:0,default_idl:0,job:0,come:0,tue:0,addit:0,last:0,admin:0,fault:0,etc:0,instanc:0,mani:0,com:0,improp:0,load:0,simpli:0,point:0,"1000107bfb0":0,rpm:0,casus:0,coredump:0,been:0,mark:0,much:0,sshkei:0,popul:0,quickli:0,largesmp:0,anywher:0,try_crashdump:0,"0000000000000e86":0,present:0,therefor:0,look:0,rbx:0,solid:0,mount:0,rbp:0,defin:0,abov:0,error:0,"101f21efb20":0,ffffffff8047a0b0:0,timefram:0,rip:0,destin:0,call_function_interrupt:0,archiv:0,uncom:0,cherrypi:0,fedorahost:0,sever:0,fedora:0,author:0,media:0,same:0,binari:0,timestamp:0,x86:0,someon:0,temporari:0,user:0,"500gb":0,stack:0,task:0,"10001073e98":0,entri:0,do_invalid_op:0,exampl:0,command:0,thi:0,filesystem:0,gzip:0,fail:0,latest:0,identifi:0,execut:0,workdirectori:0,heavili:0,previous:0,samba:0,except:0,valid:0,match:0,bin:0,read:0,kmem:0,debuglevel:0,smtphost:0,mod:0,"1000107bfa0":0,resid:0,like:0,specif:0,anyon:0,manual:0,resolv:0,server:0,collect:0,necessari:0,either:0,"101f21efb60":0,"101f21efc40":0,output:0,page:0,some:0,back:0,gfs_quotad:0,proper:0,tmp:0,assum:0,ffffffff80529f08:0,exit:0,machin:0,intial:0,who:0,run:0,reach:0,usag:0,host:0,prerequisit:0,commun:0,unfortun:0,primarili:0,within:0,automat:0,down:0,"101f21efb50":0,strip:0,chang:0,start_disk_dump:0,storag:0,git:0,rcx:0,log:0,wai:0,area:0,transfer:0,support:0,question:0,avail:0,includ:0,suit:0,"var":0,rhel:0,analysi:0,properli:0,simplejson:0,pwd:0,sqlalchemi:0,line:0,analyst:0,info:0,made:0,possibl:0,"default":0,checkout:0,below:0,ffffffff80111c90:0,otherwis:0,problem:0,similar:0,epel:0,later:0,certain:0,dure:0,pid:0,incomplet:0,exist:0,file:0,cvzf:0,fill:0,bzip2:0,"00000100f57cb030":0,when:0,unnecessari:0,other:0,ffffffff8010e7a9:0,architectur:0,corefil:0,benefici:0,autopurg:0,ffffffff80529fb8:0,stoke:0,directori:0,descript:0,adam:0,time:0,ffffffff8010e81c:0,rpmfilter:0,cpu:0},titles:["Core Analysis System"],modules:{},descrefs:{},filenames:["index"]})
\ No newline at end of file
diff --git a/man/en/cas-admin.1 b/man/en/cas-admin.1
index 61c4045..fcd57ea 100644
--- a/man/en/cas-admin.1
+++ b/man/en/cas-admin.1
@@ -8,12 +8,9 @@ cas-admin \- Administrator tools for building rpm/server database.
\fIcas-admin\fP is a tool used to build necessary data for use with cas.
.SH OPTIONS
.TP
-.BI \-s
+.BI \--server
Populate server database for automatic processing of core files.
.TP
-.B \-b
-Populate a database with debug kernel information.
-.TP
.B \-p
Purge data based on set days (see purge options)
.SH PURGE OPTIONS
@@ -27,7 +24,7 @@ Written by Adam Stokes
.SH "REPORTING BUGS"
Report bugs to <astokes(a)redhat.com>.
.SH COPYRIGHT
-Copyright \(co 2007-2009 Adam Stokes
+Copyright \(co 2007-2010 Adam Stokes
.br
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
diff --git a/man/en/cas.1 b/man/en/cas.1
index 8c41ed7..3097a1c 100644
--- a/man/en/cas.1
+++ b/man/en/cas.1
@@ -21,6 +21,12 @@ Provide an email address for result notification
.TP
.B \-m
Extract current loaded modules from debug kernels.
+.TP
+.B \--compress " file"
+Compress file using system supplied compression utilties.
+.TP
+.B \--strip " file"
+Strips vmcore of unecessary pages. (Not active for now)
.SH RESOURCES
A configuration file is maintained in /etc/cas.conf.
.SH AUTHOR
@@ -28,7 +34,7 @@ Written by Adam Stokes
.SH "REPORTING BUGS"
Report bugs to <astokes(a)redhat.com>.
.SH COPYRIGHT
-Copyright \(co 2007-2009 Adam Stokes
+Copyright \(co 2007-2010 Adam Stokes
.br
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
14 years
Branch 'devel' - caslib/cas.py caslib/core.py caslib/rpmutils.py
by Adam Stokes
caslib/cas.py | 116 +++++++++++++++++++++++------------------------------
caslib/core.py | 5 ++
caslib/rpmutils.py | 4 +
3 files changed, 60 insertions(+), 65 deletions(-)
New commits:
commit ecf556a26b19ca054a69f3617d7294aead98e63e
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Tue May 4 15:03:15 2010 -0400
cleanup instances
diff --git a/caslib/cas.py b/caslib/cas.py
index 771bd32..777cf53 100755
--- a/caslib/cas.py
+++ b/caslib/cas.py
@@ -33,9 +33,9 @@ from urlgrabber import urlgrab
from datetime import datetime
-from caslib.network import Download, Executor, CasNetworkException
-from caslib.core import coreTimestamp, coreExtract, coreIsCorefile
-from caslib.util import UtilBase, genprint
+from caslib.network import Executor, CasNetworkException
+from caslib.core import coreTimestamp, coreExtract, coreIsCorefile, coreStrip
+from caslib.util import Utility, genprint
from caslib.rpmutils import extractDebug
from caslib import error_messages as _e
@@ -72,60 +72,54 @@ BUFFERSIZE=None
if config.has_option("advanced", "buffersize"):
BUFFERSIZE=config.get("advanced", "buffersize")
-class CoreHandler(object):
- def __init__(self, filename, dst):
- self.filename = filename
- self.basename = os.path.basename(self.filename)
- self.dst = dst
- self.currentDirectory = os.path.realpath(os.curdir)
+def coreHandler(filename, dst):
+ filename = filename
+ basename = os.path.basename(filename)
+ dst = dst
+ currentDirectory = os.path.realpath(os.curdir)
- def __call__(self):
- if coreIsCorefile(self.filename):
- # No need to proceed to extracting corefile since we assume
- # this is already at the proper stage.
- shutil.move(self.filename,
- os.path.join(self.dst, self.basename))
- self.filename = os.path.join(self.dst, self.basename)
- return self.filename
- try:
- urlgrabber.urlgrab(self.filename)
- except URLGrabError, e:
- genprint(e)
- genprint("Detected a compressed core, extracting.." \
- "please wait as this process can take a " \
- "long time.")
- # ok so some decompression utilites like gzip, bzip do not extract
- # files into the `cwd` unless specified with a to-stdout option.
- # this is a pain so we just move everything to `cwd` and proceed
- # from there.
- dst = os.path.join(self.currentDirectory, self.basename)
- shutil.move(self.filename, dst)
- corepath = coreExtract(dst)
- if not corepath:
- return _e[3]
- # corefile extracted now move it to work directory, pull basename
- # from corepath since we auto-detect the core file from extraction
- coreBasename = os.path.basename(corepath)
- shutil.move(corepath,os.path.join(self.dst, coreBasename))
- self.filename = os.path.join(self.dst, coreBasename)
- return self.filename
+ if coreIsCorefile(filename):
+ # No need to proceed to extracting corefile since we assume
+ # this is already at the proper stage.
+ shutil.move(filename,
+ os.path.join(dst, basename))
+ filename = os.path.join(dst, basename)
+ return filename
+ try:
+ urlgrabber.urlgrab(filename)
+ except URLGrabError, e:
+ genprint(e)
+ genprint("Detected a compressed core, extracting.." \
+ "please wait as this process can take a " \
+ "long time.")
+ # ok so some decompression utilites like gzip, bzip do not extract
+ # files into the `cwd` unless specified with a to-stdout option.
+ # this is a pain so we just move everything to `cwd` and proceed
+ # from there.
+ dst = os.path.join(currentDirectory, basename)
+ shutil.move(filename, dst)
+ corepath = coreExtract(dst)
+ if not corepath:
+ return _e[3]
+ # corefile extracted now move it to work directory, pull basename
+ # from corepath since we auto-detect the core file from extraction
+ coreBasename = os.path.basename(corepath)
+ shutil.move(corepath,os.path.join(dst, coreBasename))
+ filename = os.path.join(dst, coreBasename)
+ return filename
-class TimestampHandler(object):
- def __init__(self, corefile):
- self.corefile = corefile
-
- def __call__(self):
- # dig through the buildstamp database and attempt to match it with
- # the one found in the core
- timestamp = coreTimestamp(self.corefile, BUFFERSIZE)
- if not coreTimestamp:
- raise SystemExit(genprint(err))
- # query timestamp table, return tuple debuginfoRPM, and path to
- # debugKernel
- timestamp_query = session.query(Timestamp).filter_by(timestamp=timestamp).first()
- if timestamp_query:
- return (timestamp_query)
- return _e[2]
+def timestampHandler(corefile):
+ # dig through the buildstamp database and attempt to match it with
+ # the one found in the core
+ timestamp = coreTimestamp(corefile, BUFFERSIZE)
+ if not coreTimestamp:
+ raise SystemExit(genprint(err))
+ # query timestamp table, return tuple debuginfoRPM, and path to
+ # debugKernel
+ timestamp_query = session.query(Timestamp).filter_by(timestamp=timestamp).first()
+ if timestamp_query:
+ return (timestamp_query)
+ return _e[2]
class CasApplication(object):
def __init__(self, args):
@@ -161,7 +155,7 @@ class CasApplication(object):
# check if we want to strip the core
if self.opts.strip_core:
- self._strip_core(self.opts.filename)
+ coreStrip(self.opts.filename)
# check helper function first
if self.opts.compress_core:
@@ -200,21 +194,15 @@ class CasApplication(object):
self.identifier)
self.storagePath = os.path.join(self.storagePath, dateFormatted)
- # build logger object to deal with logging per job and keep things
- # clean and easy to debug
- self.casLog = Logging(self.storagePath,
- self.identifier,
- settings["DEBUGLEVEL"])
-
def run(self):
# setup directory structure
if not os.path.isdir(self.storagePath):
os.makedirs(self.storagePath)
genprint("Starting job at %s" % (self.storagePath,))
# begin core extraction analysis
- corefile = CoreHandler(self.filename, self.storagePath)
+ corefile = coreHandler(self.filename, self.storagePath)
genprint("Corefile prepared, processing %s" % (corefile,))
- debuginfo, debugKernel = TimestampHandler(corefile)
+ debuginfo, debugKernel = timestampHandler(corefile)
# we've got corefile prepped, timestamp, and debugkernel identified
# chdir into work directory and proceed
os.chdir(self.storagePath)
diff --git a/caslib/core.py b/caslib/core.py
index b4e174d..2d01bbf 100644
--- a/caslib/core.py
+++ b/caslib/core.py
@@ -145,4 +145,9 @@ def coreCompress(corefile):
cmd = "bzip2 -z %s" % (corefile,)
out, err = casexecute(cmd, output=True)
return out, err
+
+def coreStrip(corefile, level=32):
+ """ strip corefile with makedumpfile
+ """
+ pass
diff --git a/caslib/rpmutils.py b/caslib/rpmutils.py
index ab5ac6e..1a21c07 100644
--- a/caslib/rpmutils.py
+++ b/caslib/rpmutils.py
@@ -24,10 +24,12 @@ def extractDebug(rpm, dst, tool="/usr/bin/rpm2cpio",
filter="*/vmlinux", return_results=True):
""" extract file(s) from rpm
"""
+ cpio = "/bin/cpio"
+ cpio_args = "-imudv"
filter_results = []
# pipe to handle extraction, e.g. rpm2cpio \
# kernel.rpm | cpio -imud */vmlinux
- p1 = Popen([rpm2cpio, rpm], stdout=PIPE)
+ p1 = Popen([tool, rpm], stdout=PIPE)
p2 = Popen([cpio,cpio_args,filter], stdin=p1.stdout,
stdout=PIPE,stderr=PIPE)
out, err = p2.communicate()
14 years
Branch 'devel' - cas-admin caslib/rpmutils.py
by Adam Stokes
cas-admin | 6 +++---
caslib/rpmutils.py | 44 ++++++++++++++++----------------------------
2 files changed, 19 insertions(+), 31 deletions(-)
New commits:
commit 5e5e6586aeb5eb6758e9fff68a4ea5677d5d0505
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Tue May 4 14:53:26 2010 -0400
fix iter failure on callable instance
diff --git a/cas-admin b/cas-admin
index 489cc88..c884bde 100755
--- a/cas-admin
+++ b/cas-admin
@@ -75,7 +75,7 @@ def queryLocalRpms(path):
# Uses emacs regex -- see `man find`
cmd = "find -L %s -iregex %s" % (settings["KERNELS"],
settings["RPMFILTER"])
- results = casexecute(cmd, True)
+ results, err = casexecute(cmd, True)
dst = tempfile.mkdtemp(prefix='cas-')
for rpm in results.split():
@@ -86,10 +86,10 @@ def queryLocalRpms(path):
session.add(rpm_record)
session.commit()
genprint("(extracting) %-50s" % (os.path.basename(rpm),))
- results = extractDebug(rpm, dst)
+ tmpkernel = extractDebug(rpm, dst)
# Sort through extracted debug for each type
# e.g. hugemem, PAE, smp, largesmp
- for item in results:
+ for item in tmpkernel:
vmlinux = item.strip()
debugKernel = os.path.normpath(vmlinux)
timestamp = coreTimestamp(debugKernel, BUFFERSIZE)
diff --git a/caslib/rpmutils.py b/caslib/rpmutils.py
index 32ef4ed..ab5ac6e 100644
--- a/caslib/rpmutils.py
+++ b/caslib/rpmutils.py
@@ -20,33 +20,21 @@ if sys.version_info[:2] < (2,6):
else:
from subprocess import Popen, PIPE, call
-class extractDebug(object):
- """ provide file alteration tools
- """
- def __init__(self, rpm, dst, tool="/usr/bin/rpm2cpio",
+def extractDebug(rpm, dst, tool="/usr/bin/rpm2cpio",
filter="*/vmlinux", return_results=True):
- self.rpm = rpm
- self.dst = dst
- self.filter = filter
- self.rpm2cpio = tool
- self.cpio = "/bin/cpio"
- self.cpio_args = "-imudv"
- self.filter_results = []
- self.return_results = return_results
-
- def __call__(self):
- """ extract file(s) from rpm
- """
- # pipe to handle extraction, e.g. rpm2cpio \
- # kernel.rpm | cpio -imud */vmlinux
- p1 = Popen([self.rpm2cpio, self.rpm], stdout=PIPE)
- p2 = Popen([self.cpio,self.cpio_args,self.filter], stdin=p1.stdout,
- stdout=PIPE,stderr=PIPE)
- out, err = p2.communicate()
- if self.return_results:
- tmp = err.splitlines()[:-1]
- for item in tmp:
- self.filter_results.append(item)
- return self.filter_results
- return
+ """ extract file(s) from rpm
+ """
+ filter_results = []
+ # pipe to handle extraction, e.g. rpm2cpio \
+ # kernel.rpm | cpio -imud */vmlinux
+ p1 = Popen([rpm2cpio, rpm], stdout=PIPE)
+ p2 = Popen([cpio,cpio_args,filter], stdin=p1.stdout,
+ stdout=PIPE,stderr=PIPE)
+ out, err = p2.communicate()
+ if return_results:
+ tmp = err.splitlines()[:-1]
+ for item in tmp:
+ filter_results.append(item)
+ return filter_results
+ return
14 years
Branch 'devel' - cas-admin
by Adam Stokes
cas-admin | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
New commits:
commit 5561b5c8570c94b64d0c11098ec8514c9e192cb7
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Tue May 4 14:34:47 2010 -0400
fix exception during debug
diff --git a/cas-admin b/cas-admin
index c946ce8..489cc88 100755
--- a/cas-admin
+++ b/cas-admin
@@ -37,7 +37,7 @@ import tempfile
from caslib.core import casexecute, coreTimestamp
from caslib.util import Utility, genprint
-from caslib.rpmutils import RPMBase
+from caslib.rpmutils import extractDebug
from caslib import error_messages as _e
if sys.version_info[:2] < (2,6):
@@ -85,9 +85,8 @@ def queryLocalRpms(path):
rpm_record = RPM(rpm)
session.add(rpm_record)
session.commit()
- rpmTool = RPMBase()
genprint("(extracting) %-50s" % (os.path.basename(rpm),))
- results = rpmTool.extract(rpm, dst)
+ results = extractDebug(rpm, dst)
# Sort through extracted debug for each type
# e.g. hugemem, PAE, smp, largesmp
for item in results:
@@ -182,7 +181,7 @@ if __name__=="__main__":
"""initialize CAS requirements
"""
if os.getuid() is not 0:
- return _e[100]
+ raise SystemExit(_e[100])
genprint("Starting requirement processing and database creation.")
if not os.path.isdir(os.path.dirname(settings["DATABASE"])):
14 years
Branch 'devel' - Makefile
by Adam Stokes
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit a669169b221a8e3761d5a2147719978e2a4b7343
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Tue May 4 13:15:46 2010 -0400
Add overseer to subdirs
diff --git a/Makefile b/Makefile
index 76d0b9b..133ea54 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ NAME = cas
VERSION = $(shell echo `awk '/^Version:/ {print $$2}' cas.spec`)
RELEASE = $(shell echo `awk '/^Release:/ {gsub(/\%.*/,""); print $2}' cas.spec`)
-SUBDIRS = caslib contrib snippets
+SUBDIRS = caslib contrib snippets overseer
PYFILES = $(wildcard *.py)
RPM_BUILD_DIR = rpm-build
14 years
Branch 'devel' - cas.spec
by Adam Stokes
cas.spec | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit b9308d12eb19d4b1ee8c1d28c7a1299174ffd201
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Tue May 4 13:14:16 2010 -0400
Add description
diff --git a/cas.spec b/cas.spec
index 76835c9..73ab16d 100644
--- a/cas.spec
+++ b/cas.spec
@@ -41,6 +41,10 @@ Summary: Web frontend to CAS
Group: Applications/System
Requires: cas = %{version}-%{release}
+%description server
+Provides web frontend to CAS to allow for a much simpler user experience when
+dealing with vmcores.
+
%prep
%setup -q
14 years
Branch 'devel' - caslib/cas.py caslib/db.py cas.spec overseer/command.py overseer/Makefile
by Adam Stokes
cas.spec | 9 +++++++++
caslib/cas.py | 18 +++++++++++-------
caslib/db.py | 28 ++++++++++++++++++++++++----
overseer/Makefile | 18 ++++++++++++++++++
overseer/command.py | 11 +++++------
5 files changed, 67 insertions(+), 17 deletions(-)
New commits:
commit 2b4cd5509983210c86365753b1c100922622b5b7
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Tue May 4 13:13:06 2010 -0400
update overseer
diff --git a/cas.spec b/cas.spec
index ef9b4eb..76835c9 100644
--- a/cas.spec
+++ b/cas.spec
@@ -36,6 +36,11 @@ Requires: cas = %{version}-%{release}
Administrative frontend to CAS database. Provides the ability to update
the database instance with newly added kernel debug information and timestamps.
+%package server
+Summary: Web frontend to CAS
+Group: Applications/System
+Requires: cas = %{version}-%{release}
+
%prep
%setup -q
@@ -66,6 +71,10 @@ rm -rf ${RPM_BUILD_ROOT}
%defattr(-,root,root,-)
%{_bindir}/cas-admin
+%files server
+%defattr(-,root,root,-)
+%{_datadir}/%{name}/overseer
+
%changelog
* Mon May 3 2010 Adam Stokes <ajs at redhat dot com> - 0.18
- Split packages into admin/user
diff --git a/caslib/cas.py b/caslib/cas.py
index e86bae5..6195a4e 100755
--- a/caslib/cas.py
+++ b/caslib/cas.py
@@ -19,8 +19,8 @@ if sys.version_info[:2] < (2,4):
try:
from caslib.db import *
except:
- raise SystemExit('Can not interface with database, please check configuration settings' \
- 'and try again')
+ raise SystemExit('Can not interface with database, please check ' \
+ 'configuration settings and try again')
# Main requirements honored; continue.
import optparse
@@ -80,19 +80,22 @@ class CoreHandler(object):
self.tool = CoreBase()
def run(self):
- if(self.filename.startswith("http") or self.filename.startswith("ftp")):
+ if(self.filename.startswith("http") or \
+ self.filename.startswith("ftp")):
self.casLog.info("Downloading %s" % (self.filename,))
# filename is a url, process it with our download module
# this should return the the abspath to our processed directory
# and downloaded file
try:
- self.filename = Download(self.filename, self.currentDirectory).get()
+ self.filename = Download(self.filename,
+ self.currentDirectory).get()
except CasNetworkException, e:
raise SystemExit(self.casLog.debug(e))
if not os.path.isfile(self.filename):
# not a url in this case so tests for local existence
# TODO: add support to check remote hosts
- raise SystemExit(self.casLog.debug("Unable to find file %s" % (self.filename,)))
+ raise SystemExit(self.casLog.debug("Unable to find file %s" \
+ % (self.filename,)))
if self.tool.isCorefile(self.filename):
# No need to proceed to extracting corefile since we assume
# this is already at the proper stage.
@@ -101,8 +104,9 @@ class CoreHandler(object):
self.filename = os.path.join(self.dst, self.basename)
return self.filename
try:
- self.casLog.info("Detected a compressed core, extracting.. please wait as " \
- "this process can take a long time.")
+ self.casLog.info("Detected a compressed core, extracting.." \
+ "please wait as this process can take a " \
+ "long time.")
# ok so some decompression utilites like gzip, bzip do not extract
# files into the `cwd` unless specified with a to-stdout option.
# this is a pain so we just move everything to `cwd` and proceed
diff --git a/caslib/db.py b/caslib/db.py
index 49d07df..bb3c2a1 100644
--- a/caslib/db.py
+++ b/caslib/db.py
@@ -30,20 +30,36 @@ class RPM(Base):
def __repr__(self):
return "<RPM('%s')>" % (self.rpmPath,)
+class Status(Base):
+ __tablename__ = 'statuses'
+ statusId = Column(Integer, primary_key=True)
+ status = Column(String(100))
+
+ def __init__(self, status):
+ self.status = status
+
+ def __repr__(self):
+ return "<Status('%s')>" % (self.status,)
+
class Job(Base):
__tablename__ = 'jobs'
jobId = Column(Integer, primary_key=True)
identifier = Column(String(100))
email = Column(String(40))
vmcore = Column(String(255))
+ statusId = Column(Integer, ForeignKey("statuses.statusId"))
- def __init__(self, identifier, email, vmcore):
+ def __init__(self, identifier, email, vmcore, statusId):
self.identifier = identifier
self.email = email
self.vmcore = vmcore
+ self.statusId = statusId
def __repr__(self):
- return "<Job('%s','%s','%s')>" % (self.identifier, self.email, self.vmcore)
+ return "<Job('%s','%s','%s','%s')>" % (self.identifier,
+ self.email,
+ self.vmcore,
+ self.statusId)
class Timestamp(Base):
__tablename__ = 'timestamps'
@@ -58,7 +74,9 @@ class Timestamp(Base):
self.rpmId = rpmId
def __repr__(self):
- return "<Timestamp('%s','%s','%s')>" % (self.stampKey, self.debugPath, self.rpmId)
+ return "<Timestamp('%s','%s','%s')>" % (self.stampKey,
+ self.debugPath,
+ self.rpmId)
class Server(Base):
__tablename__ = 'servers'
@@ -73,7 +91,9 @@ class Server(Base):
self.arch = arch
def __repr__(self):
- return "<Server('%s','%s','%s')>" % (self.hostname, self.port, self.arch)
+ return "<Server('%s','%s','%s')>" % (self.hostname,
+ self.port,
+ self.arch)
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
diff --git a/overseer/Makefile b/overseer/Makefile
new file mode 100644
index 0000000..325a84f
--- /dev/null
+++ b/overseer/Makefile
@@ -0,0 +1,18 @@
+PYTHON=python
+NAME=cas
+PACKAGE = $(shell basename `pwd`)
+PYFILES = $(wildcard *.py)
+PKGDIR = /usr/share/$(NAME)/$(PACKAGE)
+
+all:
+ echo "nada"
+
+clean:
+ rm -f *.pyc *.pyo *~
+
+install:
+ mkdir -p $(DESTDIR)/$(PKGDIR)
+ for p in $(PYFILES) ; do \
+ install -m 755 $$p $(DESTDIR)/$(PKGDIR)/$$p; \
+ done
+ $(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(PKGDIR)', 1, '$(PYDIR)', 1)"
diff --git a/overseer/command.py b/overseer/command.py
index 9f9d454..86f8a76 100755
--- a/overseer/command.py
+++ b/overseer/command.py
@@ -18,9 +18,6 @@
import cherrypy
import simplejson as json
-import ConfigParser
-from datetime import datetime
-import urlgrabber.grabber as grabber
from caslib.db import *
class Admin:
@@ -33,10 +30,12 @@ class Delegate:
return
@cherrypy.expose
- def create(self, vmcore, email):
+ def create(self, identifier, email, vmcore):
""" Create job """
- datenow = datetime.now()
- dateFormatted = datenow.strftime("%Y.%m.%d.%I.%M.%S")
+ job_record = Job(identifier, email, vmcore)
+ session.add(job_record)
+ session.commit()
+ return json.encode(job_record)
@cherrypy.expose
def status(self, id):
14 years
Branch 'devel' - caslib/cas.py caslib/db.py
by Adam Stokes
caslib/cas.py | 49 ++++++++++++++++++++++++++++++++++++++-----------
caslib/db.py | 7 ++++---
2 files changed, 42 insertions(+), 14 deletions(-)
New commits:
commit 630c42e2ea80cdde2c3a839d27b2c1a12180318a
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Mon May 3 21:22:56 2010 -0400
updating cas interface to db
diff --git a/caslib/cas.py b/caslib/cas.py
index 38fd2d5..e86bae5 100755
--- a/caslib/cas.py
+++ b/caslib/cas.py
@@ -14,6 +14,15 @@
""" cas - core accessibility system.
"""
import sys
+if sys.version_info[:2] < (2,4):
+ raise SystemExit("Python >= 2.4 required")
+try:
+ from caslib.db import *
+except:
+ raise SystemExit('Can not interface with database, please check configuration settings' \
+ 'and try again')
+
+# Main requirements honored; continue.
import optparse
import os
import ConfigParser
@@ -25,8 +34,7 @@ from datetime import datetime
from caslib.network import Download, Executor, CasNetworkException
from caslib.core import CoreBase, CoreException
-from caslib.db import CasStorage, CasStorageException
-from caslib.util import UtilBase, Logging, genprint
+from caslib.util import UtilBase, genprint
from caslib.rpmutils import RPMBase
if sys.version_info[:2] < (2,6):
@@ -117,7 +125,6 @@ class TimestampHandler(object):
self.casLog = logger
self.util = UtilBase()
self.tool = CoreBase()
- self.db = database
def run(self):
# dig through the buildstamp database and attempt to match it with the
@@ -128,15 +135,13 @@ class TimestampHandler(object):
raise SystemExit(self.casLog.debug(err))
# query timestamp table, return tuple debuginfoRPM, and path to
# debugKernel
- timestamp_query = self.db.getTimestampDebug(coreTimestamp)
+ timestamp_query = session.query(Timestamp).filter_by(timestamp=coreTimestamp).first()
if timestamp_query:
return (timestamp_query)
raise SystemExit(self.casLog.debug("Unable to match timestamp %s" % (coreTimestamp,)))
class CasApplication(object):
def __init__(self, args):
- self.db = CasStorage(settings["DATABASE"])
- self.db.connect()
self.parse_options(args)
self.util = UtilBase()
self.rpmTool = RPMBase()
@@ -149,6 +154,9 @@ class CasApplication(object):
raise SystemExit(genprint("File compressed: %s" % (filename,)))
except CoreException, e:
raise SystemExit(genprint(e))
+
+ def _strip_core(self, filename):
+ pass
def parse_options(self, args):
# build option - arguement list in the form of
@@ -166,15 +174,39 @@ class CasApplication(object):
parser.add_option("-c","--compress", dest="compress_core",
help="Helper option to compress core to be transferred "\
"to another destination.", action="store_true")
+ parser.add_option("--strip", dest="strip_core",
+ help="Strip out unecessary pages from core file",
+ action="store_true")
+ parser.add_option("--job", dest="job",
+ help="Attach to an existing job")
+
self.opts, args = parser.parse_args()
if not self.opts.filename:
parser.error("A file object is missing.")
+ # check if we want to strip the core
+ if self.opts.strip_core:
+ self._strip_core(self.opts.filename)
+
# check helper function first
if self.opts.compress_core:
self._helper_compress(self.opts.filename)
+ # Add job to database, this allows us to purge
+ # data based on job date creation then by other
+ # means. (i.e. identifier == a bugzilla #)
+ if not self.opts.job:
+ self.job_record = Job(self.identifier, dateFormatted, self.email)
+ session.add(self.job_record)
+ session.commit()
+ else:
+ self.job_record = session.query(Job.identifier==self.opts.job).first()
+ if not self.job_record:
+ raise SystemExit("The specified job does not exist, re-run with correct Job " \
+ "or without --job defined to create a new Job.")
+
+
# Not compressing lets continue with validating a identifier
if not self.opts.identifier:
parser.error("A unique identifier number is missing.")
@@ -194,11 +226,6 @@ class CasApplication(object):
# clean and easy to debug
self.casLog = Logging(self.storagePath, self.identifier, settings["DEBUGLEVEL"])
- # Add job to database, this allows us to purge
- # data based on job date creation then by other
- # means. (i.e. identifier == a bugzilla #)
- self.db.addJob(self.identifier, dateFormatted, self.email)
-
def run(self):
# setup directory structure
if not os.path.isdir(self.storagePath):
diff --git a/caslib/db.py b/caslib/db.py
index aa42497..49d07df 100644
--- a/caslib/db.py
+++ b/caslib/db.py
@@ -33,16 +33,17 @@ class RPM(Base):
class Job(Base):
__tablename__ = 'jobs'
jobId = Column(Integer, primary_key=True)
+ identifier = Column(String(100))
email = Column(String(40))
vmcore = Column(String(255))
- def __init__(self, jobId, email, vmcore):
- self.jobId = jobId
+ def __init__(self, identifier, email, vmcore):
+ self.identifier = identifier
self.email = email
self.vmcore = vmcore
def __repr__(self):
- return "<Job('%s','%s','%s')>" % (self.jobId, self.email, self.vmcore)
+ return "<Job('%s','%s','%s')>" % (self.identifier, self.email, self.vmcore)
class Timestamp(Base):
__tablename__ = 'timestamps'
14 years
Branch 'devel' - cas-admin caslib/db.py cas.spec overseer/command.py
by Adam Stokes
cas-admin | 17 +++++------------
cas.spec | 17 +++++++++++++++--
caslib/db.py | 14 ++++++++++++++
overseer/command.py | 47 ++++++++++++++++++++---------------------------
4 files changed, 54 insertions(+), 41 deletions(-)
New commits:
commit c9bafde81c7672b292cdaf10c6e07fec0c79a801
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Mon May 3 20:50:02 2010 -0400
function
diff --git a/cas-admin b/cas-admin
index b61e2c8..eb83c2c 100755
--- a/cas-admin
+++ b/cas-admin
@@ -33,6 +33,7 @@ import ConfigParser
import optparse
import datetime
import paramiko
+import tempfile
from caslib.core import CoreBase, casexecute
from caslib.util import UtilBase, genprint
@@ -68,26 +69,18 @@ def queryLocalRpms(path):
Arguments:
- `path`: filesystem location of debug kernels
"""
- localRpms = []
# Uses emacs regex -- see `man find`
cmd = "find -L %s -iregex %s" % (settings["KERNELS"], settings["RPMFILTER"])
results = casexecute(cmd, True)
- count = 0
- for rpm in results.split():
- localRpms.append(rpm)
- genprint("(found) %-5d kernels(s)" % (count,))
- count = count + 1
- dst = os.path.join(settings["DEBUGS"], str(count))
- if not os.path.isdir(dst):
- os.makedirs(dst)
-
- for rpm in localRpms:
- rpm_IN_DB = session.query(RPM).filter_by(rpmPath=rpm)
+ dst = tempfile.mkdtemp(prefix='cas-')
+ for rpm in results.split():
+ rpm_IN_DB = session.query(RPM).filter_by(rpmPath=rpm).first()
if not rpm_IN_DB:
# add RPM to database
rpm_record = RPM(rpm)
session.add(rpm_record)
+ session.commit()
rpmTool = RPMBase()
genprint("(extracting) %-50s" % (os.path.basename(rpm),))
results = rpmTool.extract(rpm, dst)
diff --git a/cas.spec b/cas.spec
index f712db5..ef9b4eb 100644
--- a/cas.spec
+++ b/cas.spec
@@ -6,7 +6,7 @@ Version: 0.18
Release: 0%{?dist}
Source0: https://fedorahosted.org/releases/c/a/cas/%{name}-%{version}.tar.gz
License: GPLv3+
-Group: Development/Libraries
+Group: Applications/System
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch: noarch
Url: http://fedorahosted.org/cas
@@ -27,6 +27,15 @@ CAS provides a user the ability to configure an environment for core analysis
quickly. All the hassles of matching kernel versions and machine architecture
types to core dumps are automatically detected and processed.
+%package admin
+Summary: Administrative frontend to CAS
+Group: Applications/System
+Requires: cas = %{version}-%{release}
+
+%description admin
+Administrative frontend to CAS database. Provides the ability to update
+the database instance with newly added kernel debug information and timestamps.
+
%prep
%setup -q
@@ -45,7 +54,6 @@ rm -rf ${RPM_BUILD_ROOT}
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/cas.conf
%{_bindir}/cas
-%{_bindir}/cas-admin
%{python_sitelib}/*
%{_mandir}/man1/*
%{_mandir}/man5/*
@@ -54,8 +62,13 @@ rm -rf ${RPM_BUILD_ROOT}
%config(noreplace) %{_var}/lib/cas/snippets/*
%doc AUTHORS LICENSE README PKG-INFO doc/*
+%files admin
+%defattr(-,root,root,-)
+%{_bindir}/cas-admin
+
%changelog
* Mon May 3 2010 Adam Stokes <ajs at redhat dot com> - 0.18
+- Split packages into admin/user
- Rewrote database interface using sqlalchemy
- Reworked cas-admin to interface with new database format
diff --git a/caslib/db.py b/caslib/db.py
index 8321fa3..aa42497 100644
--- a/caslib/db.py
+++ b/caslib/db.py
@@ -30,6 +30,20 @@ class RPM(Base):
def __repr__(self):
return "<RPM('%s')>" % (self.rpmPath,)
+class Job(Base):
+ __tablename__ = 'jobs'
+ jobId = Column(Integer, primary_key=True)
+ email = Column(String(40))
+ vmcore = Column(String(255))
+
+ def __init__(self, jobId, email, vmcore):
+ self.jobId = jobId
+ self.email = email
+ self.vmcore = vmcore
+
+ def __repr__(self):
+ return "<Job('%s','%s','%s')>" % (self.jobId, self.email, self.vmcore)
+
class Timestamp(Base):
__tablename__ = 'timestamps'
stampId = Column(Integer, primary_key=True)
diff --git a/overseer/command.py b/overseer/command.py
old mode 100644
new mode 100755
index a750669..9f9d454
--- a/overseer/command.py
+++ b/overseer/command.py
@@ -1,49 +1,42 @@
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#!/usr/bin/python
+# command
+# Overseer command for returning json data via RESTful calls
+# Copyright (C) 2010 Adam Stokes
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
import cherrypy
import simplejson as json
import ConfigParser
from datetime import datetime
import urlgrabber.grabber as grabber
-from caslib.db import CasStorage
+from caslib.db import *
class Admin:
pass
class Delegate:
- def __init__(self):
- cfg = ConfigParser.ConfigParser()
- cfg.read("/etc/cas.conf")
- db_file = cfg.get("settings", "database")
- self.db = CasStorage(db_file)
-
@cherrypy.expose
def index(self):
- """ Catchall call; returns current running jobs """
- return json.dumps(self.db.getAllJobs())
+ """ Ability to create/query jobs """
+ return
@cherrypy.expose
def create(self, vmcore, email):
""" Create job """
datenow = datetime.now()
dateFormatted = datenow.strftime("%Y.%m.%d.%I.%M.%S")
- try:
- grabber(vmcore)
- except grabber.URLGrabError, e:
- return json.dumps(e)
- self.db.addJob(id, dateFormatted, email)
- return json.dumps(id)
@cherrypy.expose
def status(self, id):
14 years