I needed to list repos from spacecmd.  See attached.

Also, it would be nice if repos could be associated etc. from spacecmd.

Thanks,
Trent


--- old//usr/lib/python2.6/site-packages/spacecmd/softwarechannel.py 2011-03-28 07:45:40.062935272 -0500 +++ /usr/lib/python2.6/site-packages/spacecmd/softwarechannel.py 2011-03-28 07:40:13.962940058 -0500
@@ -67,6 +67,21 @@
             print '\n'.join(sorted(channels))

 ####################
+def help_softwarechannel_listrepos(self):
+    print 'softwarechannel_listrepos: List all available user repos'
+    print 'usage: softwarechannel_listrepos'
+
+def do_softwarechannel_listrepos(self, args, doreturn=False):
+    repos = self.client.channel.software.listUserRepos(self.session)
+    repos = [c.get('label') for c in repos]
+
+    if doreturn:
+        return repos
+    else:
+        if len(repos):
+            print '\n'.join(sorted(repos))
+
+####################

 def help_softwarechannel_listbasechannels(self):
print 'softwarechannel_listbasechannels: List all base software channels'
@@ -260,6 +275,38 @@

 ####################

+def help_softwarechannel_repodetails(self):
+    print 'softwarechannel_repodetails: Show the details of a user repo'
+    print 'usage: softwarechannel_repodetails <repo ...>'
+
+def complete_softwarechannel_repodetails(self, text, line, beg, end):
+    return tab_completer(self.do_softwarechannel_listrepos('', True), text)
+
+def do_softwarechannel_repodetails(self, args):
+    (args, options) = parse_arguments(args)
+
+    if not len(args):
+        self.help_softwarechannel_repodetails()
+        return
+
+    # allow globbing of software channel names
+ repos = filter_results(self.do_softwarechannel_listrepos('', True), args)
+
+    add_separator = False
+
+    for repo in repos:
+        details = self.client.channel.software.getRepoDetails(\
+                                    self.session, repo)
+
+        if add_separator: print self.SEPARATOR
+        add_separator = True
+
+        print 'Repository Label:   %s' % details.get('label')
+        print 'Repository Url:     %s' % details.get('sourceUrl')
+        print 'Repository Type:    %s' % details.get('type')
+
+####################
+
 def help_softwarechannel_listerrata(self):
     print 'softwarechannel_listerrata: List the errata associated with a'
     print '                            software channel'

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to