示例#1
0
    def test_search(self):
        self.args = self.parser.parser.parse_args('search ruby'.split())
        pulp = j(self.args)
        mute()(pulp.search)(pkg_name=self.args.rpmname)

        self.args = self.parser.parser.parse_args(\
            'search ruby --in qa'.split())
        pulp = j(self.args)
        mute()(pulp.search)(pkg_name=self.args.rpmname)
示例#2
0
def delete_rpm(args):
    pulp = j(args)
    for env in args.environment:
        for repo in args.r:
            repo_name = "%s-%s" % (repo[0], env)
            rpms = repo[1:len(repo)]
            pulp.delete_rpms(repo_name, rpms, env)
示例#3
0
def delete_rpm(args):
    pulp = j(args)
    for env in args.environment:
        for repo in args.r:
            repo_name = "%s-%s" % (repo[0], env)
            rpms = repo[1:len(repo)]
            pulp.delete_rpms(repo_name, rpms, env)
示例#4
0
def push(args):
    pulp = j(args)
    for env in args.environment:
        cart = juicer.common.Cart.Cart(args.cartname,
                                       autoload=True,
                                       autosync=True)
        pulp.push(cart, env)
示例#5
0
def upload(args):
    pulp = j(args)

    cart = pulp.create("upload-cart", args.r)
    cart.sync_remotes()

    for env in args.environment:
        pulp.push(cart, env)
示例#6
0
def upload(args):
    pulp = j(args)

    cart = pulp.create("upload-cart", args.r)
    cart.sync_remotes()

    for env in args.environment:
        pulp.push(cart, env)
示例#7
0
def update(args):
    pulp = j(args)

    if not args.r and not args.f:
        raise JuicerError("Argument Error")

    cart = pulp.update(args.cartname, args.r, args.f)

    juicer.utils.Log.log_info("Updated cart '%s'." % cart.cart_name)
示例#8
0
def update(args):
    pulp = j(args)

    if not args.r and not args.f:
        raise JuicerError("Argument Error")

    cart = pulp.update(args.cartname, args.r, args.f)

    juicer.utils.Log.log_info("Updated cart '%s'." % cart.cart_name)
示例#9
0
    def _test_pull(self):
        if os.path.exists(self.cpath):
            os.remove(self.cpath)

        self.args = self.parser.parser.parse_args(('cart pull %s' % self.cname).split())
        pulp = j(self.args)
        mute()(pulp.pull)(self.cname)

        self.assertTrue(os.path.exists(self.cpath))
示例#10
0
    def _test_pull(self):
        if os.path.exists(self.cpath):
            os.remove(self.cpath)

        self.args = self.parser.parser.parse_args(('cart pull %s' % self.cname).split())
        pulp = j(self.args)
        mute()(pulp.pull)(self.cname)

        self.assertTrue(os.path.exists(self.cpath))
示例#11
0
def create(args):
    pulp = j(args)
    juicer.utils.Log.log_info("Creating cart '%s'." % args.cartname)

    if args.f:
        juicer.utils.Log.log_debug("Manifest detected.")

        cart = pulp.create_manifest(args.cartname, args.f)
    elif args.r:
        cart = pulp.create(args.cartname, args.r)
    else:
        raise JuicerError("Argument Error")
示例#12
0
def create(args):
    pulp = j(args)
    juicer.utils.Log.log_info("Creating cart '%s'." % args.cartname)

    if args.f:
        juicer.utils.Log.log_debug("Manifest detected.")

        pulp.create_manifest(args.cartname, args.f)
    elif args.r:
        pulp.create(args.cartname, args.r)
    else:
        raise JuicerError("Argument Error")
示例#13
0
    def test_workflow(self):
        rpm_path = './share/juicer/empty-0.0.1-1.fc17.x86_64.rpm'

        if os.path.exists(self.cpath):
            os.remove(self.cpath)

        # test uploading an rpm
        self.args = self.parser.parser.parse_args(('upload -r %s %s' % ('hats', rpm_path)).split())
        pulp = j(self.args)
        cart = pulp.create('upload-cart', self.args.r)

        self.args = self.parser.parser.parse_args('push upload-cart'.split())
        pulp = j(self.args)
        mute()(pulp.push)(cart)

        # test creating a cart
        self.args = self.parser.parser.parse_args(('create CHG0DAY -r %s %s' \
                % ('hats', rpm_path)).split())
        pulp = j(self.args)
        mute()(pulp.create)(cart_name=self.args.cartname, cart_description=self.args.r)

        # test pushing a cart
        self.args = self.parser.parser.parse_args(('create %s -r hats %s' \
                % (self.cname, rpm_path)).split())
        pulp = j(self.args)
        cart = juicer.common.Cart.Cart(self.args.cartname, autoload=True, autosync=True)
        mute()(pulp.push)(cart=cart)

        # test promoting a cart
        cart = juicer.common.Cart.Cart(self.cname, autoload=True)
        old_env = cart.current_env

        self.args = self.parser.parser.parse_args(('promote %s' % self.cname).split())
        pulp = j(self.args)
        mute()(pulp.promote)(cart_name=self.args.cartname)

        cart = juicer.common.Cart.Cart(self.cname, autoload=True)

        self.assertFalse(cart.current_env == old_env)

        # test creating a cart from manifest
        new_cname = 'CHG1DAY'

        self.args = self.parser.parser.parse_args(('create %s -f %s' \
                % (new_cname, './share/juicer/rpm-manifest.yaml')).split())
        pulp = j(self.args)
        mute()(pulp.create_manifest)(cart_name=self.args.cartname, manifests=self.args.f)

        cart = juicer.common.Cart.Cart(new_cname, autoload=True)

        self.assertFalse(cart.is_empty())
示例#14
0
def promote(args):
    pulp = j(args)
    pulp.promote(cart_name=args.cartname)
示例#15
0
def publish(args):
    pulp = j(args)
    for env in args.environment:
        pulp.publish_repo(args.repo, env)
示例#16
0
def promote(args):
    pulp = j(args)
    pulp.promote(cart_name=args.cartname)
示例#17
0
    def _test_workflow(self):
        rpm_path = '../../share/juicer/empty-0.1-1.noarch.rpm'
        rpm2_path = '../../share/juicer/alsoempty-0.1-1.noarch.rpm'

        if os.path.exists(self.cpath):
            os.remove(self.cpath)

        # test uploading an rpm
        self.args = self.parser.parser.parse_args(
            ('rpm upload -r %s %s' % (self.rname, rpm_path)).split())
        pulp = j(self.args)
        cart = pulp.create('upload-cart', self.args.r)

        self.args = self.parser.parser.parse_args('cart push upload-cart'.split())
        pulp = j(self.args)
        mute()(pulp.push)(cart)

        # test searching for an rpm
        self.args = self.parser.parser.parse_args('rpm search %s'.split())
        pulp = j(self.args)
        mute()(pulp.search)(pkg_name=self.args.rpmname)

        self.args = self.parser.parser.parse_args(
            'rpm search %s --in re'.split())
        pulp = j(self.args)
        mute()(pulp.search)(pkg_name=self.args.rpmname)

        # test creating a cart
        self.args = self.parser.parser.parse_args(('cart create %s -r %s %s %s' %
                                                   (self.cname,
                                                    self.rname,
                                                    rpm_path,
                                                    rpm2_path)).split())
        pulp = j(self.args)
        mute()(pulp.create)(cart_name=self.args.cartname, cart_description=self.args.r)

        # test pushing a cart
        self.args = self.parser.parser.parse_args(('cart create %s -r %s %s' %
                                                   (self.cname,
                                                    self.rname,
                                                    rpm_path)).split())
        pulp = j(self.args)
        cart = juicer.common.Cart.Cart(self.args.cartname, autoload=True, autosync=True)
        mute()(pulp.push)(cart=cart)

        # test promoting a cart
        cart = juicer.common.Cart.Cart(self.cname, autoload=True)
        old_env = cart.current_env

        self.args = self.parser.parser.parse_args(('cart promote %s' % self.cname).split())
        pulp = j(self.args)
        mute()(pulp.promote)(cart_name=self.args.cartname)

        cart = juicer.common.Cart.Cart(self.cname, autoload=True)

        self.assertFalse(cart.current_env == old_env)

        # test creating a cart from manifest
        new_cname = self.cname + "1"

        self.args = self.parser.parser.parse_args(('cart create %s -f %s' %
                                                   (new_cname, '../../share/juicer/rpm-manifest.yaml')).split())
        pulp = j(self.args)
        mute()(pulp.create_manifest)(cart_name=self.args.cartname, manifests=self.args.f)

        cart = juicer.common.Cart.Cart(new_cname, autoload=True)

        self.assertFalse(cart.is_empty())

        # test deleting a cart
        self.args = self.parser.parser.parse_args(('cart delete %s' % \
                                        (self.cname)).split())
        pulp = j(self.args)

        mute()(pulp.delete)(cartname=cart.cart_name)
        self.assertFalse(os.path.exists(cart.cart_file()))

        cart = juicer.common.Cart.Cart(self.cname, autoload=True)
        mute()(pulp.delete)(cartname=cart.cart_name)
        self.assertFalse(os.path.exists(cart.cart_file()))
示例#18
0
 def _test_hello(self):
     self.args = self.parser.parser.parse_args(
         ("hello --in %s" % self._defaults['start_in']).split())
     pulp = j(self.args)
     mute()(pulp.hello)()
示例#19
0
def show(args):
    pulp = j(args)
    cart = pulp.show(args.cartname)
    print cart
示例#20
0
def list(args):
    pulp = j(args)
    for cart in pulp.list(args.cart_glob):
        print cart
示例#21
0
def show(args):
    pulp = j(args)
    cart = pulp.show(args.cartname, args.environment)
    print cart
示例#22
0
def show(args):
    pulp = j(args)
    cart = pulp.show(args.cartname)
    print cart
示例#23
0
def delete(args):
    pulp = j(args)
    pulp.delete(cartname=args.cartname)
示例#24
0
def publish(args):
    pulp = j(args)
    for env in args.environment:
        pulp.publish_repo(args.repo, env)
示例#25
0
def merge(args):
    pulp = j(args)
    pulp.merge(carts=args.carts, new_cart_namename=args.new_cart_name)
示例#26
0
 def test_show(self):
     self.args = self.parser.parser.parse_args(('show %s' % self.cname).split())
     pulp = j(self.args)
     mute()(pulp.show)(self.cname)
示例#27
0
def pull(args):
    pulp = j(args)
    pulp.pull(args.cartname)
示例#28
0
 def test_hello(self):
     self.args = self.parser.parser.parse_args('hello'.split())
     pulp = j(self.args)
     mute()(pulp.hello)()
示例#29
0
文件: __init__.py 项目: RoUS/juicer
def prune_repo(args):
    pulp = j(args)
    pulp.prune_repo(args.reponame, args.daycount, args.envs)
示例#30
0
 def _test_show(self):
     self.args = self.parser.parser.parse_args(('cart show %s' % self.cname).split())
     pulp = j(self.args)
     mute()(pulp.show)(self.cname, get_environments())
示例#31
0
    def _test_workflow(self):
        rpm_path = '../../share/juicer/empty-0.1-1.noarch.rpm'
        rpm2_path = '../../share/juicer/alsoempty-0.1-1.noarch.rpm'

        if os.path.exists(self.cpath):
            os.remove(self.cpath)

        # test uploading an rpm
        self.args = self.parser.parser.parse_args(
            ('rpm upload -r %s %s' % (self.rname, rpm_path)).split())
        pulp = j(self.args)
        cart = pulp.create('upload-cart', self.args.r)

        self.args = self.parser.parser.parse_args(
            'cart push upload-cart'.split())
        pulp = j(self.args)
        mute()(pulp.push)(cart)

        # test searching for an rpm
        self.args = self.parser.parser.parse_args('rpm search %s'.split())
        pulp = j(self.args)
        mute()(pulp.search)(pkg_name=self.args.rpmname)

        self.args = self.parser.parser.parse_args(
            'rpm search %s --in re'.split())
        pulp = j(self.args)
        mute()(pulp.search)(pkg_name=self.args.rpmname)

        # test creating a cart
        self.args = self.parser.parser.parse_args(
            ('cart create %s -r %s %s %s' %
             (self.cname, self.rname, rpm_path, rpm2_path)).split())
        pulp = j(self.args)
        mute()(pulp.create)(cart_name=self.args.cartname,
                            cart_description=self.args.r)

        # test pushing a cart
        self.args = self.parser.parser.parse_args(
            ('cart create %s -r %s %s' %
             (self.cname, self.rname, rpm_path)).split())
        pulp = j(self.args)
        cart = juicer.common.Cart.Cart(self.args.cartname,
                                       autoload=True,
                                       autosync=True)
        mute()(pulp.push)(cart=cart)

        # test promoting a cart
        cart = juicer.common.Cart.Cart(self.cname, autoload=True)
        old_env = cart.current_env

        self.args = self.parser.parser.parse_args(
            ('cart promote %s' % self.cname).split())
        pulp = j(self.args)
        mute()(pulp.promote)(cart_name=self.args.cartname)

        cart = juicer.common.Cart.Cart(self.cname, autoload=True)

        self.assertFalse(cart.current_env == old_env)

        # test creating a cart from manifest
        new_cname = self.cname + "1"

        self.args = self.parser.parser.parse_args(
            ('cart create %s -f %s' %
             (new_cname, '../../share/juicer/rpm-manifest.yaml')).split())
        pulp = j(self.args)
        mute()(pulp.create_manifest)(cart_name=self.args.cartname,
                                     manifests=self.args.f)

        cart = juicer.common.Cart.Cart(new_cname, autoload=True)

        self.assertFalse(cart.is_empty())

        # test deleting a cart
        self.args = self.parser.parser.parse_args(('cart delete %s' % \
                                        (self.cname)).split())
        pulp = j(self.args)

        mute()(pulp.delete)(cartname=cart.cart_name)
        self.assertFalse(os.path.exists(cart.cart_file()))

        cart = juicer.common.Cart.Cart(self.cname, autoload=True)
        mute()(pulp.delete)(cartname=cart.cart_name)
        self.assertFalse(os.path.exists(cart.cart_file()))
示例#32
0
 def _test_hello(self):
     self.args = self.parser.parser.parse_args(("hello --in %s" % self._defaults['start_in']).split())
     pulp = j(self.args)
     mute()(pulp.hello)()
示例#33
0
def list(args):
    pulp = j(args)
    for cart in pulp.list(args.cart_glob):
        print cart
示例#34
0
def hello(args):
    pulp = j(args)
    pulp.hello()
示例#35
0
def push(args):
    pulp = j(args)
    for env in args.environment:
        cart = juicer.common.Cart.Cart(args.cartname, autoload=True, autosync=True)
        pulp.push(cart, env)
示例#36
0
def merge(args):
    pulp = j(args)
    pulp.merge(carts=args.carts, new_cart_namename=args.new_cart_name)
示例#37
0
 def _test_show(self):
     self.args = self.parser.parser.parse_args(
         ('cart show %s' % self.cname).split())
     pulp = j(self.args)
     mute()(pulp.show)(self.cname, get_environments())
示例#38
0
def search(args):
    pulp = j(args)
    pulp.search(pkg_name=args.rpmname, search_carts=args.carts)
示例#39
0
def hello(args):
    pulp = j(args)
    pulp.hello()
示例#40
0
def show(args):
    pulp = j(args)
    cart = pulp.show(args.cartname, args.environment)
    print cart
示例#41
0
 def test_show(self):
     self.args = self.parser.parser.parse_args(
         ('show %s' % self.cname).split())
     pulp = j(self.args)
     mute()(pulp.show)(self.cname)
示例#42
0
def pull(args):
    pulp = j(args)
    pulp.pull(args.cartname)
示例#43
0
 def test_hello(self):
     self.args = self.parser.parser.parse_args('hello'.split())
     pulp = j(self.args)
     mute()(pulp.hello)()
示例#44
0
    def test_workflow(self):
        rpm_path = './share/juicer/empty-0.0.1-1.fc17.x86_64.rpm'

        if os.path.exists(self.cpath):
            os.remove(self.cpath)

        # test uploading an rpm
        self.args = self.parser.parser.parse_args(\
                ('upload -r %s %s' % (self.rname, rpm_path)).split())
        pulp = j(self.args)
        cart = pulp.create('upload-cart', self.args.r)

        self.args = self.parser.parser.parse_args('push upload-cart'.split())
        pulp = j(self.args)
        mute()(pulp.push)(cart)

        # test searching for an rpm
        self.args = self.parser.parser.parse_args('search %s'.split())
        pulp = j(self.args)
        mute()(pulp.search)(pkg_name=self.args.rpmname)

        self.args = self.parser.parser.parse_args(\
            'search %s --in re'.split())
        pulp = j(self.args)
        mute()(pulp.search)(pkg_name=self.args.rpmname)

        # test creating a cart
        self.args = self.parser.parser.parse_args(('create CHG0DAY -r %s %s' \
                % ('hats', rpm_path)).split())
        pulp = j(self.args)
        mute()(pulp.create)(cart_name=self.args.cartname,
                            cart_description=self.args.r)

        # test pushing a cart
        self.args = self.parser.parser.parse_args(('create %s -r hats %s' \
                % (self.cname, rpm_path)).split())
        pulp = j(self.args)
        cart = juicer.common.Cart.Cart(self.args.cartname,
                                       autoload=True,
                                       autosync=True)
        mute()(pulp.push)(cart=cart)

        # test promoting a cart
        cart = juicer.common.Cart.Cart(self.cname, autoload=True)
        old_env = cart.current_env

        self.args = self.parser.parser.parse_args(
            ('promote %s' % self.cname).split())
        pulp = j(self.args)
        mute()(pulp.promote)(cart_name=self.args.cartname)

        cart = juicer.common.Cart.Cart(self.cname, autoload=True)

        self.assertFalse(cart.current_env == old_env)

        # test creating a cart from manifest
        new_cname = 'CHG1DAY'

        self.args = self.parser.parser.parse_args(('create %s -f %s' \
                % (new_cname, './share/juicer/rpm-manifest.yaml')).split())
        pulp = j(self.args)
        mute()(pulp.create_manifest)(cart_name=self.args.cartname,
                                     manifests=self.args.f)

        cart = juicer.common.Cart.Cart(new_cname, autoload=True)

        self.assertFalse(cart.is_empty())
示例#45
0
文件: __init__.py 项目: RoUS/juicer
def delete(args):
    pulp = j(args)
    pulp.delete(cartname=args.cartname)
示例#46
0
def search(args):
    pulp = j(args)
    pulp.search(pkg_name=args.rpmname, search_carts=args.carts)
示例#47
0
def prune_repo(args):
    pulp = j(args)
    pulp.prune_repo(args.reponame, args.daycount, args.envs)