Esempio n. 1
0
def main():

    opts = parseOpts()
    dbcfg = config.DBConfig()
    rhncfg = config.RHNConfig()

    sdb = pysqlite.PySqliteDB(dbcfg)
    db = rhndb.RHNStore(sdb)

    if not opts.localdb:
        rhn = RHNClient(rhncfg.getURL())
        rhn.connect(rhncfg.getUserName(), rhncfg.getPassword())

        populate(db, rhn)

    if opts.csv:
        print "Writing CSV file..."
        doCSV(db)
    else:
        doHTML(db)
Esempio n. 2
0
def main():
    rhncfg = config.RHNConfig()
    rhn = RHNClient(rhncfg.getURL())
    rhn.connect(rhncfg.getUserName(), rhncfg.getPassword())

    channels = rhn.server.channel.list_software_channels(rhn.session)

    for chan in channels:
        packages = rhn.server.channel.software.list_all_packages(
            rhn.session, chan['channel_label'])

        for p in packages:
            if havePackage(chan['channel_label'], p):
                continue

            location, source = bruteForceFind(p)

            if location == None:
                print "Error: Could not find binary package:"
                print p
            else:
                buildTreeUsing(chan['channel_label'], location, source)
Esempio n. 3
0
def main():
    rhncfg = config.RHNConfig()
    rhn = RHNClient(rhncfg.getURL())
    rhn.connect(rhncfg.getUserName(), rhncfg.getPassword())

    channels = rhn.server.channel.list_software_channels(rhn.session)

    for chan in channels:
        packages = rhn.server.channel.software.list_all_packages(rhn.session,
                                                  chan['channel_label'])

        for p in packages:
            if havePackage(chan['channel_label'], p):
                continue

            location, source = bruteForceFind(p)

            if location == None:
                print "Error: Could not find binary package:"
                print p
            else:
                buildTreeUsing(chan['channel_label'], location, source)
Esempio n. 4
0
def main():

    print "Search and Destroy old RHN registrations."
    print

    o = cliOptions()

    rhn = RHNClient(o.server)
    rhn.connect()

    print "RHN API Version: %s" % rhn.server.api.system_version()
    print "Today's date = %s" % date.today().isoformat()
    print

    list = search(rhn, o.days)
    for s in list:
        print s["name"]

    print "There are %s inactive systems." % len(list)

    if o.delete:
        print "Going to delete these registrations.  Hit ^C to abort now!"
        time.sleep(5)
        delete(rhn, list, o.noconfirm)
Esempio n. 5
0
def main():

    print "Search and Destroy old RHN registrations."
    print

    o = cliOptions()

    rhn = RHNClient(o.server)
    rhn.connect()

    print "RHN API Version: %s" % rhn.server.api.system_version()
    print "Today's date = %s" % date.today().isoformat()
    print

    list = search(rhn, o.days)
    for s in list:
        print s["name"]

    print "There are %s inactive systems." % len(list)

    if o.delete:
        print "Going to delete these registrations.  Hit ^C to abort now!"
        time.sleep(5)
        delete(rhn, list, o.noconfirm)
Esempio n. 6
0
# (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., 675 Mass Ave, Cambridge, MA 02139, USA.

import sys

from rhnapi import RHNClient

rhn = RHNClient("https://rhn.linux.ncsu.edu/rpc/api")
rhn.connect()

print "RHN API Version: %s" % rhn.server.api.system_version()

print "Session ID = %s" % rhn.session

s = rhn.server

group_tally = {}
ungrouped = []
systems = s.system.list_user_systems(rhn.session)
c = 0

for system in systems:
    sys.stderr.write("Working on: %s\n" % system["name"])