spacewalk-clone-by-date fails with error "AttributeError: type object 'datetime.datetime' has no attribute 'strptime'"

Solution Verified - Updated -

Issue

  • On Red Hat Satellite 5.6 spacewalk-clone-by-date fails when using configuration file.
    For example:

    # cat clone-03Nov15.cfg 
    {
    "assumeyes":true,
    "to_date": "2015-11-03",
    "skip_depsolve":false,
    "security_only":false,
    "blacklist": {
                 },
    "removelist": {
                 },
    "channels":[
                {
                "rhel-x86_64-server-7": "rhel-x86_64-server-7_03Nov15"  
                }
              ]
    }
    

    The spacewalk-clone-by-date fails to clone channel.

    # spacewalk-clone-by-date --config="/path-to/clone-03Nov15.cfg" --username "admin" --password "password"
    Reading repository information.
    Using issue_date.
    By continuing the following will be cloned:
    rhel-x86_64-server-7 -> rhel-x86_64-server-7_03Nov15  (673/675 Errata)
    Copying repodata, please wait.
    Solving Dependencies (4311): 
    ######################################## - complete
    Processing Dependencies:
    ########################################Traceback (most recent call last):
    File "/usr/bin/spacewalk-clone-by-date", line 253, in ?
      sys.exit(abs(main() or 0))
    File "/usr/bin/spacewalk-clone-by-date", line 243, in main
      return cloneByDate.main(args)
    File "/usr/share/rhn/utils/cloneByDate.py", line 177, in main
      cloner.create_channels(options.skip_depsolve)
    File "/usr/share/rhn/utils/cloneByDate.py", line 302, in create_channels
      self.dep_solve(nvreas, labels=(to_create.keys() + [self.src_parent]))
    File "/usr/share/rhn/utils/cloneByDate.py", line 385, in dep_solve
      self.__dep_solve(nvrea_list)
    File "/usr/share/rhn/utils/cloneByDate.py", line 397, in __dep_solve
      self.process_deps(dep_results)
    File "/usr/share/rhn/utils/cloneByDate.py", line 429, in process_deps
      added_nevras = added_nevras + cloner.process_deps(needed)
    File "/usr/share/rhn/utils/cloneByDate.py", line 523, in process_deps
      if not self.to_date or (self.to_date and \
    AttributeError: type object 'datetime.datetime' has no attribute 'strptime'
    

Environment

  • Red Hat Satellite 5.6
  • Red Hat Enterprise Linux 5
  • spacewalk-utils-2.0.2-26.el5sat.noarch

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content