[Spacewalk-devel] Newbie trying to test my code changes
Hello there, first time user. I'm trying to test my changes to the code by building from source, but I can't figure out how to do so. I've gotten as far as using 'tito build --test --rpm" in spacewalk/java as per https://www.redhat.com/archives/spacewalk-list/2013-February/msg00052.html. My "test" to see if I am working from my updated code has been to git rm EnabledListSetupAction.java, and commit the change to git. Then I run tito build --test --rpm in spacewalk/java, and rpm -ivh --replacefiles the resulting packages (skipping the spacewalk-java-lib package, because that breaks the client even without my changes). After I start Spacewalk back up, navigating to /rhn/users/ActiveList.do still functions. It is my understanding that without EnabledListSetupAction (as per https://fedorahosted.org/spacewalk/wiki/TracingaPage) this should no longer work. Any help with this specific line of thinking would be greatly appreciated, but, more generally, how do I build the project to test my changes to the code? My senior thesis is to make a contribution to the project, but I'm having the hardest time just setting up an environment where I can make changes -> see results, and I only have 3 weeks left. Thank you for your time, Austin E. Lavinghouse PS- If I'm doing anything wrong re: formatting, mailing list etiquette, please let me know! ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Newbie trying to test my code changes
On Mon, Nov 11, 2013 at 1:23 PM, Stephen Herr wrote: > Oh, and upon re-reading I realized: You can't skip spacewalk-java-lib. > That's the rpm that contains all the really important stuff. What client are > you breaking by installing it? > > Another thing to consider is that if you installed the Spacewalk 2.0 rpms > you probably want to be making your changes on top of the SPACEWALK-2.0 > branch, not master. The code in master may have been updated to rely on > changes made in other packages, for example the database schema, and may > break if installed on a 2.0 system. Once you have your changes working on > the SPACEWALK-2.0 branch it would probably be a clean merge over to master. > > -Stephen Thanks for noticing that! I'll pull the 2.0 branch and start working from there, using the same stop - change - commit - tito - rpm - start process. > On 11/11/2013 02:10 PM, Stephen Herr wrote: >> >> Hi Austin, >> >> Assuming that you really are sucessfully building and installing the rpm, >> the only thing that occures to me is that you should restart the tomcat >> service (probably 'tomcat6' or 'tomcat' depending on your setup). This >> forces it to reload cached content. >> >> In general that's a fine approach to take. /var/log/httpd/error_log and >> /var/log//catalina.out are some error logs it might be very useful >> for you to watch when you're testing your changes. In the former you'll >> generally see exceptions generated in the python and perl layers, in the >> latter you'll see exceptions generated in the java layer. >> >> -Stephen Herr I have been using /usr/sbin/spacewalk-service stop / start before making any changes. Thanks for the logs, I'm not getting errors in either; however, I think I discovered the reason for that. rpm -qa | grep spacewalk shows that both spacewalk-java-2.0.5-1.el6.noarch *and* -2.1.54-1.git.0.5c89a47.el6.noarch are installed, so the java is probably running out of the 2.0. Thus, my changes aren't doing anything (but I'm also not buggering up the system by trying to install 2.1 on top of it!). Going to remove the 2.1 package, pull the 2.0 down, and give it a shot. Thanks for your help! Updates in a bit as soon as I try it. ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Newbie trying to test my code changes
On Mon, Nov 11, 2013 at 1:36 PM, Austin Lavinghouse wrote: > On Mon, Nov 11, 2013 at 1:23 PM, Stephen Herr wrote: >> Oh, and upon re-reading I realized: You can't skip spacewalk-java-lib. >> That's the rpm that contains all the really important stuff. What client are >> you breaking by installing it? >> >> Another thing to consider is that if you installed the Spacewalk 2.0 rpms >> you probably want to be making your changes on top of the SPACEWALK-2.0 >> branch, not master. The code in master may have been updated to rely on >> changes made in other packages, for example the database schema, and may >> break if installed on a 2.0 system. Once you have your changes working on >> the SPACEWALK-2.0 branch it would probably be a clean merge over to master. >> >> -Stephen > > Thanks for noticing that! I'll pull the 2.0 branch and start working > from there, using the same stop - change - commit - tito - rpm - start > process. > Alright, that worked just fine! Thanks Stephen. For posterity's sake, here are the steps to modify the code and test your changes (this isn't documented anywhere that I could find): 1. Setup Spacewalk on the system you want to develop on. 2. Use git to clone from the repo. Make sure you are working in the same branch as the installed system's version; for example, use --branch=SPACEWALK-2.0. 3. Modify whatever code you would like. Make sure you use "git add " and then "git commit -m ''." 4. Navigate to the closest directory upwards with a .spec file. 5. Run "tito build --test --rpm". The --test flag prevents you from building from the original repo, and uses your commits instead. 6. Navigate to /tmp/tito, and install the package(s) using "rpm -ivh --replacefiles ". 7. Restart Spacewalk using "/usr/sbin/spacewalk-service restart" to start from the new packages. Note this doesn't mean you shouldn't write the appropriate tests for the code. Thanks again for the help! A. E. Lavinghouse ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
[Spacewalk-devel] Perl Script - XMLRPC Error, passing correct params
So this script is simply intended to get the info needed from two systems, and sync them. But no matter what I try, I get the same "Fault returned from XML RPC Server, fault code 1213: redstone.xmlrpc.XmlRpcFault: No packages to sync" error. The relevant part of the script: my $package_metadata = $client->call('system.compare_packages', $session, $group_sids[1], $group_sids[0]); #DEBUG print(Dumper($package_metadata)); #Alrighty so we can in fact compare two systems. Let's see if we can sync them. First, grab dat package id my @package_ids; foreach my $package (@$package_metadata) { push(@package_ids,$package->{'package_name_id'}); } foreach (@package_ids) { print "Id: ".$_."\n"; } #now schedule that sync # the group sids are client sids from a selected group. my $action_id = $client->call('system.schedule_sync_packages_with_system', $session, $group_sids[1], $group_sids[0], \@package_ids, $date_time); The output ($VAR1 is from a dump of the comparison): $VAR1 = [ { 'comparison' => '1', 'package_name_id' => '3379', 'package_arch' => 'x86_64', 'package_name' => 'emacs', 'this_system' => '23.1-21.el6_2.3:1' }, ... snipped, the other packages are listed below.. ]; Id: 3379 Id: 4341 Id: 4342 Id: 3789 Id: 1901 Id: 2808 Id: 4277 Id: 500 Fault returned from XML RPC Server, fault code 1213: redstone.xmlrpc.XmlRpcFault: No packages to sync >From the log: [2013-11-26 19:01:13,264] ERROR - REQUESTED FROM: 192.168.56.101 CALL: system.schedule_sync_packages_with_system(200x03ed0fcac2a5df0f098e48ad068ced79, 110001, 11, [3379, 4341, 4342, 3789, 1901, 2808, 4277, 500], Tue Nov 26 19:02:10 CST 2013) CALLER: (george) TIME: 1.59 seconds redstone.xmlrpc.XmlRpcFault: No packages to sync at com.redhat.rhn.frontend.xmlrpc.BaseHandler.invoke(BaseHandler.java:158) at redstone.xmlrpc.XmlRpcDispatcher.dispatch(XmlRpcDispatcher.java:123) ...snipped At first I was getting the same error in spacecmd, but by installing new packages (originally nmap was the only difference) I was able to successfully schedule the sync event; I confirmed this through the web GUI. I have tried switching the target system with the profiled system both in the comparison and the sync, but no combination has yielded anything other than the error described above. Any help would be greatly appreciated, I've been banging my head against the keyboard for several hours now. Thanks so much! Austin Lavinghouse ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Perl Script - XMLRPC Error, passing correct params
All, I solved my issue. the scheduleSyncPackagesWithSystem is asking for a list of ALL packages on the source system, and it runs the comparison itself. As I was running the comparison before hand, the package ids supplied to the API method were the *missing* packages- and so it saw no packages on the system, and returned the appropriate error. Thanks, Austin Lavinghouse ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
[Spacewalk-devel] Contribution: Normalization Script
I just finished writing & testing a script that, given a group, will sync every system in that group with a target system. This script was written for my senior thesis. What's the proper way to contribute it such that it can be added to the spacewalk/scripts directory? You can view the script here: turing.cs.olemiss.edu/~aelaving/normalize.py Any comments or critiques would be most appreciated. Thanks, A. E. Lavinghouse ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel