4 commits - rel-eng/packages spacewalk/admin
by Miroslav Suchý
rel-eng/packages/spacewalk-admin | 2
spacewalk/admin/LICENSE | 339 +++++++++++++++++++++++++++++++++++
spacewalk/admin/spacewalk-admin.spec | 16 +
3 files changed, 352 insertions(+), 5 deletions(-)
New commits:
commit f1b6c2496c326c968cddb149206937613e7896a0
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 26 09:25:02 2012 +0200
Automatic commit of package [spacewalk-admin] release [1.8.1-1].
diff --git a/rel-eng/packages/spacewalk-admin b/rel-eng/packages/spacewalk-admin
index 23055b8..8c5d23f 100644
--- a/rel-eng/packages/spacewalk-admin
+++ b/rel-eng/packages/spacewalk-admin
@@ -1 +1 @@
-1.7.4-1 spacewalk/admin/
+1.8.1-1 spacewalk/admin/
diff --git a/spacewalk/admin/spacewalk-admin.spec b/spacewalk/admin/spacewalk-admin.spec
index ea91451..c456f7a 100644
--- a/spacewalk/admin/spacewalk-admin.spec
+++ b/spacewalk/admin/spacewalk-admin.spec
@@ -2,7 +2,7 @@
Summary: Various utility scripts and data files for RHN Satellite installations
Name: spacewalk-admin
URL: https://fedorahosted.org/spacewalk
-Version: 1.8.0
+Version: 1.8.1
Release: 1%{?dist}
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
License: GPLv2
@@ -73,6 +73,12 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) %{_sysconfdir}/rhn/service-list
%changelog
+* Mon Mar 26 2012 Miroslav Suchý 1.8.1-1
+- 737972 - use %%global, not %%define
+- 737972 - add license text
+- 737972 - using packages rather than filedesps
+- Bumping package versions for 1.8. (jpazdziora(a)redhat.com)
+
* Fri Mar 02 2012 Jan Pazdziora 1.7.4-1
- Update the copyright year info.
commit 9b6cf1f85c59f01f9a076c50b184863a2dd5c7d0
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 26 09:07:35 2012 +0200
737972 - use %global, not %define
http://fedoraproject.org/wiki/Packaging:Guidelines#.25global_preferred_ov...
diff --git a/spacewalk/admin/spacewalk-admin.spec b/spacewalk/admin/spacewalk-admin.spec
index a408751..ea91451 100644
--- a/spacewalk/admin/spacewalk-admin.spec
+++ b/spacewalk/admin/spacewalk-admin.spec
@@ -1,4 +1,4 @@
-%define rhnroot /%{_datadir}/rhn
+%global rhnroot /%{_datadir}/rhn
Summary: Various utility scripts and data files for RHN Satellite installations
Name: spacewalk-admin
URL: https://fedorahosted.org/spacewalk
commit 64f1066f43da433cf46df075e74bfb584651a875
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 26 09:19:55 2012 +0200
737972 - add license text
http://fedoraproject.org/wiki/Packaging:LicensingGuidelines#License_Text
diff --git a/spacewalk/admin/LICENSE b/spacewalk/admin/LICENSE
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/spacewalk/admin/LICENSE
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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 2 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, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/spacewalk/admin/spacewalk-admin.spec b/spacewalk/admin/spacewalk-admin.spec
index ab59c70..a408751 100644
--- a/spacewalk/admin/spacewalk-admin.spec
+++ b/spacewalk/admin/spacewalk-admin.spec
@@ -50,6 +50,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
+%doc LICENSE
%dir %{rhnroot}
%{_sbindir}/spacewalk-service
%{_sbindir}/rhn-satellite
commit 25775b3ab041f7d46f10415d68680407d4a56675
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 26 09:15:10 2012 +0200
737972 - using packages rather than filedesps
http://fedoraproject.org/wiki/Packaging:Guidelines#File_Dependencies
diff --git a/spacewalk/admin/spacewalk-admin.spec b/spacewalk/admin/spacewalk-admin.spec
index fde1b91..ab59c70 100644
--- a/spacewalk/admin/spacewalk-admin.spec
+++ b/spacewalk/admin/spacewalk-admin.spec
@@ -11,8 +11,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: spacewalk-base
Requires: perl-URI, perl(MIME::Base64)
Requires: sudo
-Requires: /sbin/restorecon
-Requires: /usr/sbin/lsof
+# for /sbin/restorecon
+Requires: policycoreutils
+Requires: lsof
Obsoletes: satellite-utils < 5.3.0
Provides: satellite-utils = 5.3.0
Obsoletes: rhn-satellite-admin < 5.3.0
12 years, 2 months
web/html web/modules
by StephenHerr
web/html/nav/system_detail.xml | 4 ++--
web/modules/rhn/RHN/Access.pm | 11 +++++++++++
web/modules/rhn/RHN/DB/Server.pm | 11 +++++++++++
3 files changed, 24 insertions(+), 2 deletions(-)
New commits:
commit 82ea3cdf5e0e4fcbcfb23a112576e61167139067
Author: Stephen Herr <sherr(a)redhat.com>
Date: Fri Mar 23 15:29:44 2012 -0400
806439 - Changing perl sitenav too
diff --git a/web/html/nav/system_detail.xml b/web/html/nav/system_detail.xml
index cba9a94..0480369 100644
--- a/web/html/nav/system_detail.xml
+++ b/web/html/nav/system_detail.xml
@@ -173,10 +173,10 @@
<rhn-tab name="Join" url="/rhn/systems/details/groups/Add.do"/>
</rhn-tab>
- <rhn-tab name="Virtualization" acl="not system_is_virtual(); system_has_virtualization_entitlement()">
+ <rhn-tab name="Virtualization" acl="not system_is_virtual(); system_has_management_entitlement()">
<rhn-tab-url>/rhn/systems/details/virtualization/VirtualGuestsList.do</rhn-tab-url>
<rhn-tab name="Details" url="/rhn/systems/details/virtualization/VirtualGuestsList.do"/>
- <rhn-tab name="Provisioning" url="/rhn/systems/details/virtualization/ProvisionVirtualizationWizard.do"/>
+ <rhn-tab name="Provisioning" url="/rhn/systems/details/virtualization/ProvisionVirtualizationWizard.do" acl="system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)"/>
</rhn-tab>
<rhn-tab name="Groups" url="/rhn/systems/details/groups/ListRemove.do" acl="system_feature(ftr_system_grouping); not user_role(org_admin); not user_role(system_group_admin)"/>
diff --git a/web/modules/rhn/RHN/Access.pm b/web/modules/rhn/RHN/Access.pm
index c423d68..c1432f7 100644
--- a/web/modules/rhn/RHN/Access.pm
+++ b/web/modules/rhn/RHN/Access.pm
@@ -50,6 +50,7 @@ sub register_acl_handlers {
$acl->register_handler(system_is_virtual => \&system_is_virtual_acl_test);
$acl->register_handler(system_is_virtual_host => \&system_is_virtual_host_acl_test);
$acl->register_handler(system_has_virtualization_entitlement => \&system_has_virtualization_entitlement_acl_test);
+ $acl->register_handler(system_has_management_entitlement => \&system_has_management_entitlement_acl_test);
}
sub user_role_acl_test {
@@ -271,6 +272,16 @@ sub system_has_virtualization_entitlement_acl_test {
return $server->has_virtualization_entitlement() ? 1 : 0;
}
+sub system_has_management_entitlement_acl_test {
+ my $pxt = shift;
+
+ my ($sid) = $pxt->param('sid');
+ throw "No sid parameter when testing to see if system is a vhost"
+ unless $sid;
+
+ my $server = lookup_system_fast($pxt, $sid);
+ return $server->has_management_entitlement() ? 1 : 0;
+}
sub formvar_exists_acl_test {
my $pxt = shift;
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 9e90fcf..f9d65fa 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -392,6 +392,17 @@ sub has_virtualization_entitlement {
}
}
+sub has_management_entitlement {
+ my $self = shift;
+
+ if ($self -> has_entitlement("enterprise_entitled")) {
+ return 1;
+ }
+ else {
+ return;
+ }
+}
+
# If the system is a proxy, return array of (epoch, version, release)
sub proxy_evr {
my $self_or_class = shift;
12 years, 2 months
java/code
by StephenHerr
java/code/src/com/redhat/rhn/common/security/acl/Access.java | 17 +++
java/code/src/com/redhat/rhn/common/security/acl/SystemAclHandler.java | 15 --
java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java | 16 ++-
java/code/src/com/redhat/rhn/common/security/acl/test/SystemAclHandlerTest.java | 15 --
java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java | 52 ++++++----
java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/VirtualGuestsListSetupAction.java | 20 +++
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 7 +
java/code/webapp/WEB-INF/nav/system_detail.xml | 4
java/code/webapp/WEB-INF/struts-config.xml | 5
9 files changed, 95 insertions(+), 56 deletions(-)
New commits:
commit 0fe863c6cc7784295aa0b041e37b054fde799190
Author: Stephen Herr <sherr(a)redhat.com>
Date: Fri Mar 23 14:36:52 2012 -0400
806439 - Make Virtualization tab of system profile independent of Virtualization (Platform) entitlements
diff --git a/java/code/src/com/redhat/rhn/common/security/acl/Access.java b/java/code/src/com/redhat/rhn/common/security/acl/Access.java
index 6053177..575efcd 100644
--- a/java/code/src/com/redhat/rhn/common/security/acl/Access.java
+++ b/java/code/src/com/redhat/rhn/common/security/acl/Access.java
@@ -126,7 +126,7 @@ public class Access extends BaseHandler {
String label = params[0];
SelectMode m = ModeFactory.getMode("Org_queries",
- "has_channel_family_entitlement");
+ "has_channel_family_entitlement");
Map queryParams = new HashMap();
queryParams.put("label", label);
queryParams.put("org_id", user.getOrg().getId());
@@ -180,6 +180,21 @@ public class Access extends BaseHandler {
}
/**
+ * Uses the sid param to decide if a system is a virtual guest
+ * @param ctx Context Map to pass in
+ * @param params Parameters to use (unused)
+ * @return true if a system is a satellite, false otherwise
+ */
+ public boolean aclSystemIsVirtual(Object ctx, String[] params) {
+ Map map = (Map) ctx;
+ Long sid = getAsLong(map.get("sid"));
+ User user = (User) map.get("user");
+ Server lookedUp = SystemManager.lookupByIdAndUser(sid, user);
+
+ return lookedUp.isVirtualGuest();
+ }
+
+ /**
* Check if a system has a management entitlement
* @param ctx Context map to pass in.
* @param params Parameters to use to fetch from context.
diff --git a/java/code/src/com/redhat/rhn/common/security/acl/SystemAclHandler.java b/java/code/src/com/redhat/rhn/common/security/acl/SystemAclHandler.java
index 6d8e071..2e99016 100644
--- a/java/code/src/com/redhat/rhn/common/security/acl/SystemAclHandler.java
+++ b/java/code/src/com/redhat/rhn/common/security/acl/SystemAclHandler.java
@@ -151,21 +151,6 @@ public class SystemAclHandler extends BaseHandler {
}
/**
- * Uses the sid param to decide if a system is a satellite server
- * @param ctx Context Map to pass in
- * @param params Parameters to use (unused)
- * @return true if a system is a satellite, false otherwise
- */
- public boolean aclSystemIsVirtual(Object ctx, String[] params) {
- Map map = (Map) ctx;
- Long sid = getAsLong(map.get("sid"));
- User user = (User)map.get("user");
- Server lookedUp = SystemManager.lookupByIdAndUser(sid, user);
-
- return lookedUp.isVirtualGuest();
- }
-
- /**
* Checks to see if the system has a KickstartSession
* @param ctx Context Map to pass in
* @param params Parameters to use (unused)
diff --git a/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java b/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java
index 0f3a9ea..f953bd0 100644
--- a/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java
+++ b/java/code/src/com/redhat/rhn/common/security/acl/test/AccessTest.java
@@ -29,7 +29,8 @@ import com.redhat.rhn.domain.server.test.ServerFactoryTest;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.domain.user.UserFactory;
import com.redhat.rhn.domain.user.legacy.UserImpl;
-import com.redhat.rhn.testing.RhnBaseTestCase;
+import com.redhat.rhn.testing.BaseTestCaseWithUser;
+import com.redhat.rhn.testing.ServerTestUtils;
import com.redhat.rhn.testing.UserTestUtils;
import java.util.Date;
@@ -42,7 +43,7 @@ import java.util.Set;
* AccessTest
* @version $Rev$
*/
-public class AccessTest extends RhnBaseTestCase {
+public class AccessTest extends BaseTestCaseWithUser {
private Acl acl;
@@ -284,6 +285,17 @@ public class AccessTest extends RhnBaseTestCase {
assertFalse(rc);
}
+ public void testIsVirtual() throws Exception {
+ Server host = ServerTestUtils.createVirtHostWithGuests(user, 1);
+ Server guest = host.getGuests().iterator().next().getGuestSystem();
+
+ Access a = new Access();
+ Map ctx = new HashMap();
+ ctx.put("sid", guest.getId());
+ ctx.put("user", user);
+ assertTrue(a.aclSystemIsVirtual(ctx, null));
+ }
+
/**
* Override the methods in User that talk to the database
*/
diff --git a/java/code/src/com/redhat/rhn/common/security/acl/test/SystemAclHandlerTest.java b/java/code/src/com/redhat/rhn/common/security/acl/test/SystemAclHandlerTest.java
index fdc00f2..82f2c81 100644
--- a/java/code/src/com/redhat/rhn/common/security/acl/test/SystemAclHandlerTest.java
+++ b/java/code/src/com/redhat/rhn/common/security/acl/test/SystemAclHandlerTest.java
@@ -26,8 +26,6 @@ import com.redhat.rhn.domain.server.test.ServerFactoryTest;
import com.redhat.rhn.manager.system.SystemManager;
import com.redhat.rhn.manager.system.test.SystemManagerTest;
import com.redhat.rhn.testing.BaseTestCaseWithUser;
-import com.redhat.rhn.testing.ServerTestUtils;
-
import java.util.HashMap;
import java.util.Map;
@@ -38,6 +36,7 @@ import java.util.Map;
public class SystemAclHandlerTest extends BaseTestCaseWithUser {
private Server srvr;
+ @Override
public void setUp() throws Exception {
super.setUp();
srvr = ServerFactoryTest.createTestServer(user);
@@ -81,16 +80,4 @@ public class SystemAclHandlerTest extends BaseTestCaseWithUser {
assertTrue(sah.aclSystemKickstartSessionExists(ctx, null));
}
- public void testIsVirtual() throws Exception {
- Server host = ServerTestUtils.createVirtHostWithGuests(user, 1);
- Server guest = host.getGuests().iterator().next().
- getGuestSystem();
-
- SystemAclHandler sah = new SystemAclHandler();
- Map ctx = new HashMap();
- ctx.put("sid", guest.getId());
- ctx.put("user", user);
- assertTrue(sah.aclSystemIsVirtual(ctx, null));
- }
-
}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java
index 7b0fd4c..bf06e28 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java
@@ -18,15 +18,20 @@ import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.validator.ValidatorError;
import com.redhat.rhn.domain.kickstart.KickstartData;
import com.redhat.rhn.domain.kickstart.KickstartFactory;
+import com.redhat.rhn.domain.rhnpackage.PackageFactory;
+import com.redhat.rhn.domain.server.InstalledPackage;
+import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.action.kickstart.KickstartHelper;
import com.redhat.rhn.frontend.action.kickstart.ScheduleKickstartWizardAction;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.struts.RhnValidationHelper;
import com.redhat.rhn.frontend.struts.wizard.WizardStep;
+import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.kickstart.KickstartScheduleCommand;
import com.redhat.rhn.manager.kickstart.ProvisionVirtualInstanceCommand;
import com.redhat.rhn.manager.kickstart.cobbler.CobblerXMLRPCHelper;
+import com.redhat.rhn.manager.system.SystemManager;
import org.apache.commons.lang.StringUtils;
import org.apache.struts.action.ActionErrors;
@@ -61,10 +66,13 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
/**
* {@inheritDoc}
*/
+ @Override
public ActionForward runFirst(ActionMapping mapping, DynaActionForm form,
RequestContext ctx, HttpServletResponse response,
WizardStep step) throws Exception {
-
+ Long sid = (Long) form.get(RequestContext.SID);
+ User user = ctx.getCurrentUser();
+ Server system = SystemManager.lookupByIdAndUser(sid, user);
if (StringUtils.isEmpty(form.getString(MEMORY_ALLOCATION))) {
form.set(MEMORY_ALLOCATION, "");
@@ -75,7 +83,16 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
}
if (StringUtils.isEmpty(form.getString(LOCAL_STORAGE_GB))) {
- form.set(LOCAL_STORAGE_GB, "");
+ form.set(LOCAL_STORAGE_GB, "");
+ }
+
+ // Check if the server already has rhnVirtHost package installed.
+ InstalledPackage rhnVirtHost = PackageFactory.lookupByNameAndServer(
+ ChannelManager.RHN_VIRT_HOST_PACKAGE_NAME, system);
+
+ if (rhnVirtHost == null) {
+ // system does not have the package installed, tell them to get it.
+ addMessage(ctx.getRequest(), "system.virtualization.help");
}
return super.runFirst(mapping, form, ctx, response, step);
@@ -103,8 +120,8 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
KickstartData ksdata = ctx.lookupAndBindKickstartData();
if (StringUtils.isEmpty(form.getString(VIRTUAL_FILE_PATH))) {
form.set(VIRTUAL_FILE_PATH, ProvisionVirtualInstanceCommand.
- makeDefaultVirtPath(form.getString(GUEST_NAME),
- ksdata.getKickstartDefaults().getVirtualizationType()));
+ makeDefaultVirtPath(form.getString(GUEST_NAME),
+ ksdata.getKickstartDefaults().getVirtualizationType()));
}
if (StringUtils.isEmpty(form.getString(MEMORY_ALLOCATION))) {
form.set(MEMORY_ALLOCATION, String.valueOf(pf.getVirtRam()));
@@ -124,7 +141,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
if (StringUtils.isEmpty(form.getString(TARGET_PROFILE_TYPE))) {
form.set(TARGET_PROFILE_TYPE,
- KickstartScheduleCommand.TARGET_PROFILE_TYPE_NONE);
+ KickstartScheduleCommand.TARGET_PROFILE_TYPE_NONE);
}
return forward;
}
@@ -132,6 +149,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
/**
* {@inheritDoc}
*/
+ @Override
public ActionForward runThird(ActionMapping mapping, DynaActionForm form,
RequestContext ctx, HttpServletResponse response,
WizardStep step) throws Exception {
@@ -157,7 +175,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
KickstartHelper helper = new KickstartHelper(ctx.getRequest());
ProvisionVirtualInstanceCommand cmd = getScheduleCommand(form,
- ctx, scheduleTime, helper.getKickstartHost());
+ ctx, scheduleTime, helper.getKickstartHost());
cmd.setKernelOptions(form.getString(KERNEL_PARAMS));
@@ -219,7 +237,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
}
@Override
protected KickstartScheduleCommand getKickstartScheduleCommand(Long sid,
- User currentUser) {
+ User currentUser) {
return new ProvisionVirtualInstanceCommand(sid, currentUser);
}
@@ -257,7 +275,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
catch (NumberFormatException e) {
errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionMessage(
"frontend.actions.systems.virt.invalidcpuvalue",
- (MAX_CPU + 1)));
+ (MAX_CPU + 1)));
}
}
@@ -286,7 +304,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
private Profile getCobblerProfile(RequestContext context) {
if (context.getRequest().getAttribute(PROFILE) == null) {
String cobblerId = (String) context.getRequest().getAttribute(
- RequestContext.COBBLER_ID);
+ RequestContext.COBBLER_ID);
User user = context.getLoggedInUser();
Profile cobblerProfile = org.cobbler.Profile.lookupById(
CobblerXMLRPCHelper.getConnection(user), cobblerId);
@@ -306,17 +324,17 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard
if (data != null) {
cmd =
- new ProvisionVirtualInstanceCommand(
- (Long) form.get(RequestContext.SID),
- data,
- ctx.getCurrentUser(),
- scheduleTime,
- host);
+ new ProvisionVirtualInstanceCommand(
+ (Long) form.get(RequestContext.SID),
+ data,
+ ctx.getCurrentUser(),
+ scheduleTime,
+ host);
}
else {
cmd = ProvisionVirtualInstanceCommand.createCobblerScheduleCommand((Long)
- form.get(RequestContext.SID), cobblerProfile.getName(),
- user, scheduleTime, host);
+ form.get(RequestContext.SID), cobblerProfile.getName(),
+ user, scheduleTime, host);
}
return cmd;
}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/VirtualGuestsListSetupAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/VirtualGuestsListSetupAction.java
index 395d0e1..46b2be7 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/VirtualGuestsListSetupAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/VirtualGuestsListSetupAction.java
@@ -16,7 +16,9 @@ package com.redhat.rhn.frontend.action.systems.virtualization;
import com.redhat.rhn.common.db.datasource.DataResult;
import com.redhat.rhn.common.localization.LocalizationService;
+import com.redhat.rhn.domain.rhnpackage.PackageFactory;
import com.redhat.rhn.domain.rhnset.RhnSet;
+import com.redhat.rhn.domain.server.InstalledPackage;
import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.action.OptionsCollectionBean;
@@ -26,6 +28,7 @@ import com.redhat.rhn.frontend.action.systems.sdc.SdcHelper;
import com.redhat.rhn.frontend.dto.VirtualSystemOverview;
import com.redhat.rhn.frontend.listview.PageControl;
import com.redhat.rhn.frontend.struts.RequestContext;
+import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.system.SystemManager;
@@ -47,6 +50,7 @@ import javax.servlet.http.HttpServletResponse;
public class VirtualGuestsListSetupAction extends BaseSystemListSetupAction {
/** {@inheritDoc} */
+ @Override
public ActionForward execute(ActionMapping mapping,
ActionForm formIn,
HttpServletRequest request,
@@ -76,6 +80,15 @@ public class VirtualGuestsListSetupAction extends BaseSystemListSetupAction {
Long sid = rctx.getRequiredParam(RequestContext.SID);
Server server = SystemManager.lookupByIdAndUser(sid, user);
+ // Check if the server already has rhnVirtHost package installed.
+ InstalledPackage rhnVirtHost = PackageFactory.lookupByNameAndServer(
+ ChannelManager.RHN_VIRT_HOST_PACKAGE_NAME, server);
+
+ if (rhnVirtHost == null) {
+ // system does not have the package installed, tell them to get it.
+ addMessage(rctx.getRequest(), "system.virtualization.help");
+ }
+
SdcHelper.ssmCheck(request, sid, user);
request.setAttribute("set", set);
request.setAttribute("pageList", dr);
@@ -125,6 +138,7 @@ public class VirtualGuestsListSetupAction extends BaseSystemListSetupAction {
* @param dr The list of System Overviews
* @param user The user viewing the System List
*/
+ @Override
public void setStatusDisplay(DataResult dr, User user) {
Iterator i = dr.iterator();
@@ -147,8 +161,8 @@ public class VirtualGuestsListSetupAction extends BaseSystemListSetupAction {
// BaseSystemListSetupAction we have no access to the
// HttpServletRequest. We need the request here to find the sid.
protected DataResult getDataResult(User user,
- PageControl pc,
- HttpServletRequest request) {
+ PageControl pc,
+ HttpServletRequest request) {
RequestContext ctx = new RequestContext(request);
Long sid = ctx.getRequiredParam(RequestContext.SID);
@@ -163,6 +177,7 @@ public class VirtualGuestsListSetupAction extends BaseSystemListSetupAction {
return dr;
}
+ @Override
protected DataResult getDataResult(User user, PageControl pc, ActionForm form) {
// Never call this.
return null;
@@ -174,6 +189,7 @@ public class VirtualGuestsListSetupAction extends BaseSystemListSetupAction {
* are to be set.
* @return set declation item
*/
+ @Override
protected RhnSetDecl getSetDecl() {
return RhnSetDecl.VIRTUAL_SYSTEMS;
}
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index a66aaf1..1b14431 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -7270,6 +7270,13 @@ Follow this url to see the full list of inactive systems:
</context-group>
</trans-unit>
+ <trans-unit id="system.virtualization.help">
+ <source>NOTE: To enable and use virtualization capabilities within Satellite for this system, install the rhn-virtualization-host package from the associated RHN Tools child channel. Review Red Hat documentation for any other considerations and requirements that Red Hat Enterprise Linux has with enabling Virtualization of a Host system.</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">/rhn/systems/details/virtualization/VirtualGuestsList.do</context>
+ </context-group>
+ </trans-unit>
+
<trans-unit id="system.entitle.alreadyvirt">
<source>A system can have either the Virtualization or Virtualization Platform entitlement but not both.</source>
<context-group name="ctx">
diff --git a/java/code/webapp/WEB-INF/nav/system_detail.xml b/java/code/webapp/WEB-INF/nav/system_detail.xml
index e2c7e8b..aed3294 100644
--- a/java/code/webapp/WEB-INF/nav/system_detail.xml
+++ b/java/code/webapp/WEB-INF/nav/system_detail.xml
@@ -174,10 +174,10 @@
<rhn-tab name="Join" url="/rhn/systems/details/groups/Add.do"/>
</rhn-tab>
- <rhn-tab name="Virtualization" acl="not system_is_virtual(); system_has_virtualization_entitlement()">
+ <rhn-tab name="Virtualization" acl="not system_is_virtual(); system_has_management_entitlement()">
<rhn-tab-url>/rhn/systems/details/virtualization/VirtualGuestsList.do</rhn-tab-url>
<rhn-tab name="Details" url="/rhn/systems/details/virtualization/VirtualGuestsList.do"/>
- <rhn-tab name="Provisioning" url="/rhn/systems/details/virtualization/ProvisionVirtualizationWizard.do"/>
+ <rhn-tab name="Provisioning" url="/rhn/systems/details/virtualization/ProvisionVirtualizationWizard.do" acl="system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)"/>
</rhn-tab>
<rhn-tab name="Audit">
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index 10c9c8a..ad0ca4d 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -3886,7 +3886,7 @@
name="virtualGuestsForm"
type="com.redhat.rhn.frontend.action.systems.virtualization.VirtualGuestsListSetupAction"
className="com.redhat.rhn.frontend.struts.RhnActionMapping">
- <set-property property="acls" value="system_has_virtualization_entitlement()"/>
+ <set-property property="acls" value="not system_is_virtual(); system_has_management_entitlement()"/>
<forward name="default"
path="/WEB-INF/pages/systems/details/virtualization/virtualguestslist.jsp"/>
</action>
@@ -6100,8 +6100,7 @@
type="com.redhat.rhn.frontend.action.systems.virtualization.ProvisionVirtualizationWizardAction"
className="com.redhat.rhn.frontend.struts.RhnActionMapping">
<set-property property="postRequiredIfSubmitted" value="true" />
-<!-- Waiting for the virtualization entitlement -->
-<!-- <set-property property="acls" value="system_feature(ftr_xen_provision_domain);>"/> -->
+ <set-property property="acls" value="not system_is_virtual(); system_has_management_entitlement();system_feature(ftr_kickstart) or system_feature(ftr_snapshotting)>"/>
<forward name="first"
path="/WEB-INF/pages/systems/details/virtualization/provision/first.jsp"/>
<forward name="second"
12 years, 2 months
java/code
by Jan Pazdziora
java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 8861ed4926c4bdd750fa8e04453030ce37c3b7c5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Mar 23 16:24:25 2012 +0100
The org_id colum is numeric, do not cast parameter to string.
Addressing
com.redhat.rhn.common.db.datasource.CachedStatement - Error while processing cached statement sql: SELECT KSIPR.kickstart_id AS id, KS.label, KSIPR.org_id,
KSIPR.min, KSIPR.max
FROM rhnKickstartIPRange KSIPR, rhnKSData KS
WHERE KSIPR.org_id = ?
AND KSIPR.min <= ?
AND KSIPR.max >= ?
AND KS.id = KSIPR.kickstart_id
ORDER BY KSIPR.min
com.redhat.rhn.common.db.WrappedSQLException: ERROR: operator does not exist: numeric = character varying
Hint: No operator matches the given name and argument type(s). You might need
to add explicit type casts.
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java
index cb3de5e..7c777e0 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java
@@ -196,7 +196,7 @@ public class KickstartManager extends BaseManager {
SelectMode mode = ModeFactory.getMode("General_queries",
"org_ks_ip_ranges_for_ip");
Map params = new HashMap();
- params.put("org_id", orgIn.getId().toString());
+ params.put("org_id", orgIn.getId());
params.put("ip", clientIpIn.getLongNumber().toString());
ipRanges = mode.execute(params);
12 years, 2 months
Changes to 'refs/tags/spacewalk-java-1.8.25-1'
by Tomas Lestach
Tag 'spacewalk-java-1.8.25-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2012-03-23 15:00 +0000
Tagging package [spacewalk-java] version [1.8.25-1] in directory [java/].
Changes since spacewalk-java-1.8.24-1:
Stephen Herr (1):
806060 - Config file diffs result in Out Of Memory for large files
Tomas Lestach (3):
752416 - reload config revision from DB before returning it
fix VirtualGuestsActionTest
Automatic commit of package [spacewalk-java] release [1.8.25-1].
---
java/code/src/com/redhat/rhn/common/filediff/Differ.java | 56 +++++++---
java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java | 2
java/code/src/com/redhat/rhn/manager/configuration/ConfigFileBuilder.java | 2
java/spacewalk-java.spec | 9 +
rel-eng/packages/spacewalk-java | 2
5 files changed, 56 insertions(+), 15 deletions(-)
---
12 years, 2 months
2 commits - java/code java/spacewalk-java.spec rel-eng/packages
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java | 2 ++
java/spacewalk-java.spec | 9 ++++++++-
rel-eng/packages/spacewalk-java | 2 +-
3 files changed, 11 insertions(+), 2 deletions(-)
New commits:
commit da71bc585efafe38fa8607a84de81486147f127f
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Mar 23 16:00:10 2012 +0100
Automatic commit of package [spacewalk-java] release [1.8.25-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 626e089..3855f80 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -22,7 +22,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.8.24
+Version: 1.8.25
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -603,6 +603,13 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Fri Mar 23 2012 Tomas Lestach <tlestach(a)redhat.com> 1.8.25-1
+- fix VirtualGuestsActionTest (tlestach(a)redhat.com)
+- 752416 - reload config revision from DB before returning it
+ (tlestach(a)redhat.com)
+- 806060 - Config file diffs result in Out Of Memory for large files
+ (sherr(a)redhat.com)
+
* Thu Mar 22 2012 Tomas Lestach <tlestach(a)redhat.com> 1.8.24-1
- fix ServerFactoryVirtualizationTest (tlestach(a)redhat.com)
- fix ServerFactoryTest (tlestach(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 0d8603a..e108ffc 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.8.24-1 java/
+1.8.25-1 java/
commit 03df28fece79f19036c995d94119844fb1219ebc
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Mar 23 11:45:20 2012 +0100
fix VirtualGuestsActionTest
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java
index 42ab8a1..8897eb4 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/test/VirtualGuestsActionTest.java
@@ -66,6 +66,7 @@ public class VirtualGuestsActionTest extends RhnMockStrutsTestCase {
virtualInstance.setUuid("1234");
virtualInstance.setGuestSystem(guest);
virtualInstance.setHostSystem(host);
+ virtualInstance.setConfirmed(1L);
virtualInstance.setState(VirtualInstanceFactory.getInstance().getRunningState());
addRequestParameter(RequestContext.SID, host.getId().toString());
@@ -114,6 +115,7 @@ public class VirtualGuestsActionTest extends RhnMockStrutsTestCase {
VirtualInstance virtualInstance = new VirtualInstance();
virtualInstance.setUuid("1234");
virtualInstance.setGuestSystem(guest);
+ virtualInstance.setConfirmed(0L);
ServerFactory.save(guest);
new VirtualInstanceFactory().saveVirtualInstance(virtualInstance);
12 years, 2 months
java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/manager/configuration/ConfigFileBuilder.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 9f312438c263899b64fc218e0ae707f5a46f21f1
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Mar 23 13:59:32 2012 +0100
752416 - reload config revision from DB before returning it
diff --git a/java/code/src/com/redhat/rhn/manager/configuration/ConfigFileBuilder.java b/java/code/src/com/redhat/rhn/manager/configuration/ConfigFileBuilder.java
index 74d49c1..a51418d 100644
--- a/java/code/src/com/redhat/rhn/manager/configuration/ConfigFileBuilder.java
+++ b/java/code/src/com/redhat/rhn/manager/configuration/ConfigFileBuilder.java
@@ -184,7 +184,7 @@ public class ConfigFileBuilder {
// Committing the revision commits the file for us (which commits the
// Channel, so everybody's pointers get updated...)
ConfigurationFactory.commit(revision);
- return revision;
+ return (ConfigRevision) ConfigurationFactory.reload(revision);
}
12 years, 2 months
java/code
by StephenHerr
java/code/src/com/redhat/rhn/common/filediff/Differ.java | 56 +++++++++++----
1 file changed, 44 insertions(+), 12 deletions(-)
New commits:
commit 623df35a7ee271e713f908dced5f04d0ce06d434
Author: Stephen Herr <sherr(a)redhat.com>
Date: Thu Mar 22 14:36:28 2012 -0400
806060 - Config file diffs result in Out Of Memory for large files
diff --git a/java/code/src/com/redhat/rhn/common/filediff/Differ.java b/java/code/src/com/redhat/rhn/common/filediff/Differ.java
index 449962d..caa24a3 100644
--- a/java/code/src/com/redhat/rhn/common/filediff/Differ.java
+++ b/java/code/src/com/redhat/rhn/common/filediff/Differ.java
@@ -14,6 +14,8 @@
*/
package com.redhat.rhn.common.filediff;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -22,9 +24,11 @@ import java.util.List;
* @version $Rev$
*/
public class Differ {
- private Trace head;
+ private final Trace head;
private Trace beforeCurrent;
private int bestSoFar;
+ private static final int NUMBEROFTRACESTOKEEP = 1000;
+ private final List<Integer> matches = new ArrayList<Integer>();
/**
* @param oldLength The length of the old file
@@ -52,24 +56,52 @@ public class Differ {
}
/**
- * The crux of the optimization for this algorithm lies in the fact that
- * we will step through all of the traces in parallel rather than
- * recursively. This allows us to delete traces that can't possibly
- * be the most optimal.
+ * The crux of the optimization for this algorithm lies in the fact that we
+ * will step through all of the traces in parallel rather than recursively.
+ * This allows us to delete traces that are unlikely be the most optimal.
+ *
+ * We only consider the best {@value #NUMBEROFTRACESTOKEEP} traces at any
+ * given time. This is to prevent the memory required from growing
+ * exponentially in large files. The resulting trace is always guaranteed to
+ * be *correct*, but maybe not *optimal*.
*
* This will call the step function on Trace for every current trace we
- * have. It will delete traces that cannot be optimal.
- * @param oldFile The old(first, from) file
- * @param newFile The new(second, to) file
- * @return A list of Hunks representing the differences.
- * null if we need to step again
+ * have. It will delete traces that are unlikely to be optimal.
+ *
+ * @param oldFile
+ * The old(first, from) file
+ * @param newFile
+ * The new(second, to) file
+ * @return A list of Hunks representing the differences. null if we need to
+ * step again
*/
private List step(String[] oldFile, String[] newFile) {
beforeCurrent = head;
boolean forked;
+ int minimumMatchValue = 0;
+
+ // get a list of all match values for all traces
+ while (beforeCurrent.next() != null) {
+ beforeCurrent = beforeCurrent.next();
+ matches.add(beforeCurrent.getMatches());
+ }
+
+ // if we have too many traces find the match number you need to beat to
+ // remain valid
+ if (matches.size() > NUMBEROFTRACESTOKEEP) {
+ Collections.sort(matches); // sort ascending
+ minimumMatchValue = matches.get(matches.size() -
+ NUMBEROFTRACESTOKEEP);
+ }
+
+ // reset things before the "real" iteration
+ matches.clear();
+ beforeCurrent = head;
+
while (beforeCurrent.next() != null) {
- //delete impossible traces.
- if (bestSoFar > beforeCurrent.next().bestPossible()) {
+ // delete impossible and unlikely traces.
+ if (beforeCurrent.next().getMatches() < minimumMatchValue ||
+ bestSoFar > beforeCurrent.next().bestPossible()) {
beforeCurrent.setNext(beforeCurrent.next().next());
}
else {
12 years, 2 months
Changes to 'refs/tags/spacewalk-java-1.8.24-1'
by Tomas Lestach
Tag 'spacewalk-java-1.8.24-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2012-03-22 17:29 +0000
Tagging package [spacewalk-java] version [1.8.24-1] in directory [java/].
Changes since spacewalk-java-1.8.23-1:
Tomas Lestach (9):
Revert "fix FileFinderTest.testFindFilesSubDir"
fix KickstartManagerTest
fix AffectedSystemsActionTest
fix ServerTest
fix RamTest
fix VirtualInstanceFactoryTest
fix ServerFactoryTest
fix ServerFactoryVirtualizationTest
Automatic commit of package [spacewalk-java] release [1.8.24-1].
---
java/code/src/com/redhat/rhn/common/finder/test/FileFinderTest.java | 2
java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java | 9 ++
java/code/src/com/redhat/rhn/domain/server/test/GuestBuilder.java | 2
java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java | 1
java/code/src/com/redhat/rhn/domain/server/test/NetworkInterfaceTest.java | 8 ++
java/code/src/com/redhat/rhn/domain/server/test/RamTest.java | 31 +++++-----
java/code/src/com/redhat/rhn/domain/server/test/VirtualInstanceManufacturer.java | 1
java/code/src/com/redhat/rhn/frontend/action/errata/test/AffectedSystemsActionTest.java | 2
java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartManagerTest.java | 14 ++++
java/spacewalk-java.spec | 12 +++
rel-eng/packages/spacewalk-java | 2
11 files changed, 63 insertions(+), 21 deletions(-)
---
12 years, 2 months
9 commits - java/code java/spacewalk-java.spec rel-eng/packages
by Tomas Lestach
java/code/src/com/redhat/rhn/common/finder/test/FileFinderTest.java | 2
java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java | 9 ++
java/code/src/com/redhat/rhn/domain/server/test/GuestBuilder.java | 2
java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java | 1
java/code/src/com/redhat/rhn/domain/server/test/NetworkInterfaceTest.java | 8 ++
java/code/src/com/redhat/rhn/domain/server/test/RamTest.java | 31 +++++-----
java/code/src/com/redhat/rhn/domain/server/test/VirtualInstanceManufacturer.java | 1
java/code/src/com/redhat/rhn/frontend/action/errata/test/AffectedSystemsActionTest.java | 2
java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartManagerTest.java | 14 ++++
java/spacewalk-java.spec | 12 +++
rel-eng/packages/spacewalk-java | 2
11 files changed, 63 insertions(+), 21 deletions(-)
New commits:
commit 19a910ac20448d9d79a2dae709fb34766fb659e1
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Mar 22 18:29:30 2012 +0100
Automatic commit of package [spacewalk-java] release [1.8.24-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index f71245f..626e089 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -22,7 +22,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.8.23
+Version: 1.8.24
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -603,6 +603,16 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Thu Mar 22 2012 Tomas Lestach <tlestach(a)redhat.com> 1.8.24-1
+- fix ServerFactoryVirtualizationTest (tlestach(a)redhat.com)
+- fix ServerFactoryTest (tlestach(a)redhat.com)
+- fix VirtualInstanceFactoryTest (tlestach(a)redhat.com)
+- fix RamTest (tlestach(a)redhat.com)
+- fix ServerTest (tlestach(a)redhat.com)
+- fix AffectedSystemsActionTest (tlestach(a)redhat.com)
+- fix KickstartManagerTest (tlestach(a)redhat.com)
+- Revert "fix FileFinderTest.testFindFilesSubDir" (tlestach(a)redhat.com)
+
* Wed Mar 21 2012 Tomas Lestach <tlestach(a)redhat.com> 1.8.23-1
- fix LocalizationServiceTest (tlestach(a)redhat.com)
- fix AuthFilterTest (tlestach(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 8ec5e6f..0d8603a 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.8.23-1 java/
+1.8.24-1 java/
commit 1901a6180f63a07df4a7dfd437feac81b50c3718
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Mar 22 18:20:34 2012 +0100
fix ServerFactoryVirtualizationTest
diff --git a/java/code/src/com/redhat/rhn/domain/server/test/VirtualInstanceManufacturer.java b/java/code/src/com/redhat/rhn/domain/server/test/VirtualInstanceManufacturer.java
index 9274583..19c0412 100644
--- a/java/code/src/com/redhat/rhn/domain/server/test/VirtualInstanceManufacturer.java
+++ b/java/code/src/com/redhat/rhn/domain/server/test/VirtualInstanceManufacturer.java
@@ -51,6 +51,7 @@ public class VirtualInstanceManufacturer {
guest.setTotalMemory(new Long(1024 * DEFAULT_GUEST_RAM_MB));
guest.setState(state);
guest.setNumberOfCPUs(new Integer(1));
+ guest.setConfirmed(0L);
return guest;
}
commit ad2a2e9144650478991671118635823e966ce85a
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Mar 22 18:09:50 2012 +0100
fix ServerFactoryTest
diff --git a/java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java b/java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java
index 5a9fa3c..1e260ca 100644
--- a/java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java
+++ b/java/code/src/com/redhat/rhn/domain/server/test/HostBuilder.java
@@ -199,6 +199,7 @@ public class HostBuilder {
RhnBaseTestCase.assertNotNull(guest);
virtualInstance.setGuestSystem(guest);
}
+ virtualInstance.setConfirmed(host != null ? 1L : 0L);
if (host != null) {
host.addGuest(virtualInstance);
HibernateFactory.getSession().save(host);
commit 699c4af83e056015b8dc96bedb7732dce9d9a692
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Mar 22 17:55:16 2012 +0100
fix VirtualInstanceFactoryTest
diff --git a/java/code/src/com/redhat/rhn/domain/server/test/GuestBuilder.java b/java/code/src/com/redhat/rhn/domain/server/test/GuestBuilder.java
index a2a64c0..51e920f 100644
--- a/java/code/src/com/redhat/rhn/domain/server/test/GuestBuilder.java
+++ b/java/code/src/com/redhat/rhn/domain/server/test/GuestBuilder.java
@@ -105,6 +105,7 @@ public class GuestBuilder {
public GuestBuilder createUnregisteredGuest() {
guest = new VirtualInstance();
guest.setUuid(TestUtils.randomString());
+ guest.setConfirmed(0L);
return this;
}
@@ -121,6 +122,7 @@ public class GuestBuilder {
guest = new VirtualInstance();
guest.setUuid(TestUtils.randomString());
guest.setGuestSystem(ServerFactoryTest.createTestServer(owner));
+ guest.setConfirmed(0L);
return this;
}
commit f26e2ed5999969d321bd76fbdea50d91416da96c
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Mar 22 17:40:21 2012 +0100
fix RamTest
diff --git a/java/code/src/com/redhat/rhn/domain/server/test/RamTest.java b/java/code/src/com/redhat/rhn/domain/server/test/RamTest.java
index 68b0a41..3be3933 100644
--- a/java/code/src/com/redhat/rhn/domain/server/test/RamTest.java
+++ b/java/code/src/com/redhat/rhn/domain/server/test/RamTest.java
@@ -15,7 +15,6 @@
package com.redhat.rhn.domain.server.test;
import com.redhat.rhn.common.hibernate.HibernateFactory;
-import com.redhat.rhn.domain.server.Ram;
import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.testing.RhnBaseTestCase;
@@ -41,21 +40,24 @@ public class RamTest extends RhnBaseTestCase {
assertNotNull(server);
assertNotNull(server.getId());
- Ram ram = new Ram();
- ram.setServer(server);
- ram.setRam(1024);
- ram.setSwap(256);
-
- TestUtils.saveAndFlush(ram);
- verifyInDb(ram.getId(), 1024, 256);
- assertEquals(1, TestUtils.removeObject(ram));
- // can't seem to be able to delete a server, would be nice
- // to be able to clean up after ourselves.
- //assertEquals(1, TestUtils.removeObject(server));
+ server.setRam(1024);
+ server.setSwap(256);
+
+ TestUtils.saveAndFlush(server);
+ verifyInDb(server.getId(), 1024, 256);
+
+ server.setRam(2048);
+ server.setSwap(512);
+
+ TestUtils.saveAndFlush(server);
+ verifyInDb(server.getId(), 2048, 512);
+
+ assertEquals(1, TestUtils.removeObject(server));
}
- private void verifyInDb(Long id, long ram, long swap) throws Exception {
+ private void verifyInDb(Long serverId, long ram, long swap)
+ throws Exception {
// Now lets manually test to see if the user got updated
Session session = null;
Connection c = null;
@@ -67,11 +69,10 @@ public class RamTest extends RhnBaseTestCase {
assertNotNull(c);
ps = c.prepareStatement(
"SELECT ID, RAM, SWAP FROM RHNRAM " +
- " WHERE ID = " + id);
+ " WHERE SERVER_ID = " + serverId);
rs = ps.executeQuery();
rs.next();
- assertEquals(id.longValue(), rs.getLong("ID"));
assertEquals(ram, rs.getLong("RAM"));
assertEquals(swap, rs.getLong("SWAP"));
}
commit ef65d21c7b38d1c499db8bd0babfe762651b0e03
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Mar 22 15:15:37 2012 +0100
fix ServerTest
diff --git a/java/code/src/com/redhat/rhn/domain/server/test/NetworkInterfaceTest.java b/java/code/src/com/redhat/rhn/domain/server/test/NetworkInterfaceTest.java
index b7df398..b055177 100644
--- a/java/code/src/com/redhat/rhn/domain/server/test/NetworkInterfaceTest.java
+++ b/java/code/src/com/redhat/rhn/domain/server/test/NetworkInterfaceTest.java
@@ -17,6 +17,7 @@ package com.redhat.rhn.domain.server.test;
import com.redhat.rhn.common.hibernate.HibernateFactory;
import com.redhat.rhn.domain.server.NetworkInterface;
import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.domain.server.ServerNetAddress4;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.testing.RhnBaseTestCase;
import com.redhat.rhn.testing.TestUtils;
@@ -89,9 +90,14 @@ public class NetworkInterfaceTest extends RhnBaseTestCase {
NetworkInterface netint = new NetworkInterface();
netint.setHwaddr(macAddress);
netint.setModule("test");
-
netint.setName(networkName);
+ ServerNetAddress4 netAddr = new ServerNetAddress4();
+ netAddr.setAddress(ipAddress);
+ netint.setSa4(netAddr);
server.addNetworkInterface(netint);
+ netint = (NetworkInterface) TestUtils.saveAndReload(netint);
+ netAddr.setInterfaceId(netint.getInterfaceId());
+ TestUtils.saveAndFlush(netAddr);
return netint;
}
}
commit 6cb5ba2c89e05575fc50bcd1ff26e224af985b65
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Mar 22 14:59:36 2012 +0100
fix AffectedSystemsActionTest
diff --git a/java/code/src/com/redhat/rhn/frontend/action/errata/test/AffectedSystemsActionTest.java b/java/code/src/com/redhat/rhn/frontend/action/errata/test/AffectedSystemsActionTest.java
index 868aef0..15bfa35 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/errata/test/AffectedSystemsActionTest.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/errata/test/AffectedSystemsActionTest.java
@@ -63,7 +63,7 @@ public class AffectedSystemsActionTest extends MockObjectTestCase {
ActionForward sameForward = action.applyErrata((ActionMapping)mapping.proxy(),
form, request, response);
- assertEquals("path?lower=10&eid=12345", sameForward.getPath());
+ assertEquals("path?eid=12345&lower=10", sameForward.getPath());
mapping.verify();
//With systems selected
commit d4ee93b2cd61804b4951e3b7f88f34fd51bb3220
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Mar 22 14:26:10 2012 +0100
fix KickstartManagerTest
diff --git a/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java b/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java
index fb52722..ca109bd 100644
--- a/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java
+++ b/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java
@@ -21,7 +21,6 @@ import com.redhat.rhn.manager.kickstart.IpAddress;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
-
import org.hibernate.Session;
import java.io.Serializable;
@@ -340,4 +339,12 @@ public class NetworkInterface extends BaseDomainHelper implements
return sa6;
}
+ /**
+ * Setter for sa4
+ * @param sa4In sa4
+ */
+ public void setSa4(ServerNetAddress4 sa4In) {
+ this.sa4 = sa4In;
+ }
+
}
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartManagerTest.java b/java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartManagerTest.java
index 322fc28..bb012d3 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartManagerTest.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartManagerTest.java
@@ -19,6 +19,7 @@ import com.redhat.rhn.domain.kickstart.KickstartIpRange;
import com.redhat.rhn.domain.kickstart.test.KickstartDataTest;
import com.redhat.rhn.domain.server.NetworkInterface;
import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.domain.server.ServerNetAddress4;
import com.redhat.rhn.domain.server.test.ServerFactoryTest;
import com.redhat.rhn.manager.kickstart.KickstartManager;
import com.redhat.rhn.testing.BaseTestCaseWithUser;
@@ -42,7 +43,11 @@ public class KickstartManagerTest extends BaseTestCaseWithUser {
Server serv = ServerFactoryTest.createTestServer(user);
NetworkInterface nic = new NetworkInterface();
nic.setName("eth0");
+ nic.setHwaddr("aa:aa:aa");
nic.setServer(serv);
+ ServerNetAddress4 netAddr = new ServerNetAddress4();
+ netAddr.setAddress("192.168.0.122");
+ nic.setSa4(netAddr);
serv.getNetworkInterfaces().add(nic);
@@ -76,6 +81,9 @@ public class KickstartManagerTest extends BaseTestCaseWithUser {
nic = new NetworkInterface();
nic.setName("eth1");
nic.setHwaddr("aa:aa:aa");
+ ServerNetAddress4 netAddr = new ServerNetAddress4();
+ netAddr.setAddress("192.168.0.123");
+ nic.setSa4(netAddr);
nic.setServer(serv);
serv.getNetworkInterfaces().add(nic);
@@ -110,6 +118,9 @@ public class KickstartManagerTest extends BaseTestCaseWithUser {
nic.setName("eth0");
nic.setHwaddr("aa:aa:aa");
nic.setServer(serv);
+ ServerNetAddress4 netAddr = new ServerNetAddress4();
+ netAddr.setAddress("1.2.3.4");
+ nic.setSa4(netAddr);
serv.getNetworkInterfaces().add(nic);
@@ -139,6 +150,9 @@ public class KickstartManagerTest extends BaseTestCaseWithUser {
nic.setName("eth0");
nic.setHwaddr("aa:aa:aa");
nic.setServer(serv);
+ ServerNetAddress4 netAddr = new ServerNetAddress4();
+ netAddr.setAddress("1.2.3.4");
+ nic.setSa4(netAddr);
serv.getNetworkInterfaces().add(nic);
commit 6c7c2957eb5341845253faa66d8fb42deb263434
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Mar 22 11:22:15 2012 +0100
Revert "fix FileFinderTest.testFindFilesSubDir"
This reverts commit d050d344294546034bbe04e63978499404322c76.
test setup changed
diff --git a/java/code/src/com/redhat/rhn/common/finder/test/FileFinderTest.java b/java/code/src/com/redhat/rhn/common/finder/test/FileFinderTest.java
index a7462cc..fdcde6b 100644
--- a/java/code/src/com/redhat/rhn/common/finder/test/FileFinderTest.java
+++ b/java/code/src/com/redhat/rhn/common/finder/test/FileFinderTest.java
@@ -42,7 +42,7 @@ public class FileFinderTest extends RhnBaseTestCase {
assertNotNull(f);
List result = f.find(".class");
- assertEquals(4, result.size());
+ assertEquals(6, result.size());
}
public void testFindExcluding() throws Exception {
12 years, 2 months