Esempio n. 1
0
    def run_diff(self):
        uuid = self.config.get('machine', 'uuid')
        key = self.config.get('machine', 'key')

        try:
            res = self.cs.machine_sync(uuid, key, template=True)

        except ServiceException as e:
            print(e)
            return 1

        m = Machine(res['template'])
        t = Template(res['template'])

        ts = Template('system')
        ts.from_system()

        (l_r, r_l) = t.package_diff(ts.packages_all)

        print("In template not in system:")

        for p in l_r:
            print(" - {0}".format(p.name))

        print()
        print("On system not in template:")

        for p in r_l:
            print(" + {0}".format(p.name))

        print()
Esempio n. 2
0
    def run_diff(self):
        uuid = self.config.get('machine', 'uuid')
        key = self.config.get('machine', 'key')

        try:
            res = self.cs.machine_sync(uuid, key, template=True)

        except ServiceException as e:
            print(e)
            return 1

        m = Machine(res['template'])
        t = Template(res['template'])

        ts = Template.from_system()

        (l_r, r_l) = t.package_diff(ts.packages_all)

        print("In template not in system:")

        for p in l_r:
            print(" - {0}".format(p.name))

        print()
        print("On system not in template:")

        for p in r_l:
            print(" + {0}".format(p.name))

        print()
Esempio n. 3
0
    def run_diff(self):
        t = Template(self.args.template_from, user=self.args.username)

        # grab the template we're pushing to
        try:
            t = self.cs.template_get(t)

        except ServiceException as e:
            print(e)
            return 1

        # fetch template to compare to
        if self.args.template_to is not None:
            ts = Template(self.args.template_to, user=self.args.username)

            try:
                ts = self.cs.template_get(ts)

            except ServiceException as e:
                print(e)
                return 1

        # otherwise build from system
        else:
            ts = Template('system')
            ts.from_system()

        (l_r, r_l) = t.package_diff(ts.packages_all)

        if len(l_r):
            print('In template and not marked for install in system:')

            for p in l_r:
                print(" * {0}".format(p.name))

            print()

        if len(r_l):
            print('Marked for install on system and not in template:')

            for p in r_l:
                print(" * {0}".format(p.name))

        print()
Esempio n. 4
0
  def run_diff(self):
    t = Template(self.args.template_from, user=self.args.username)

    # grab the template we're pushing to
    try:
      t = self.cs.template_get(t)

    except ServiceException as e:
      print(e)
      return 1

    # fetch template to compare to
    if self.args.template_to is not None:
      ts = Template(self.args.template_to, user=self.args.username)

      try:
        ts = self.cs.template_get(ts)

      except ServiceException as e:
        print(e)
        return 1

    # otherwise build from system
    else:
      ts = Template('system')
      ts.from_system()

    (l_r, r_l) = t.package_diff(ts.packages_all)

    print("In template not in system:")

    for p in l_r:
      print(" - {0}".format(p.name))

    print()
    print("On system not in template:")

    for p in r_l:
      print(" + {0}".format(p.name))

    print()
Esempio n. 5
0
    def run_diff(self):
        t = Template(self.args.template_from, user=self.args.username)

        # grab the template we're pushing to
        try:
            t = self.cs.template_get(t)

        except ServiceException as e:
            logging.exception(e)
            return 1

        # fetch template to compare to
        if self.args.template_to is not None:
            ts = Template(self.args.template_to, user=self.args.username)

            try:
                ts = self.cs.template_get(ts)

            except ServiceException as e:
                logging.exception(e)
                return 1

        # otherwise build from system
        else:
            ts = Template.from_system()

        (l_r, r_l) = t.package_diff(ts.packages_all)

        if len(l_r):
            print('In template and not marked for install in system:')

            for p in l_r:
                print(" * {0}".format(p.name))

            print()

        if len(r_l):
            print('Marked for install on system and not in template:')

            for p in r_l:
                print(" * {0}".format(p.name))

        print()