Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 40e2f31081093569df699eb11a858fc8 > files > 136

python-copr-doc-1.94-1.mga7.noarch.rpm



<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Mock chroot &mdash; python-copr 1.63 documentation</title>
  

  
  
  
  

  
  <script type="text/javascript" src="../../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script type="text/javascript" src="../../_static/jquery.js"></script>
        <script type="text/javascript" src="../../_static/underscore.js"></script>
        <script type="text/javascript" src="../../_static/doctools.js"></script>
        <script type="text/javascript" src="../../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="General" href="../general.html" />
    <link rel="prev" title="Build task" href="build_task.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../index.html" class="icon icon-home"> python-copr
          

          
          </a>

          
            
            
              <div class="version">
                1.63
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../ClientV1.html">Legacy client</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../ClientV2.html">Client version 2</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../initialization.html">Client initialization</a></li>
<li class="toctree-l2"><a class="reference internal" href="../resources_usage.html">Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../errors.html">Error handling</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../ClientV2.html#resources-info">Resources info</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="project.html">Project</a></li>
<li class="toctree-l3"><a class="reference internal" href="project_chroot.html">Project chroot</a></li>
<li class="toctree-l3"><a class="reference internal" href="build.html">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="build_task.html">Build task</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Mock chroot</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#mock-chroot-entity-attributes">Mock chroot entity attributes</a></li>
<li class="toctree-l4"><a class="reference internal" href="#get-mock-chroot-list">Get mock chroot list</a></li>
<li class="toctree-l4"><a class="reference internal" href="#get-single-mock-chroot">Get single mock chroot</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../ClientV2.html#autodoc">Autodoc</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../ClientV3.html">Client version 3</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">python-copr</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../index.html">Docs</a> &raquo;</li>
        
          <li><a href="../../ClientV2.html">Client version 2</a> &raquo;</li>
        
      <li>Mock chroot</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../../_sources/client_v2/resource_info/mock_chroot.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="mock-chroot">
<span id="mock-chroot-info"></span><h1>Mock chroot<a class="headerlink" href="#mock-chroot" title="Permalink to this headline">¶</a></h1>
<p>Mock chroot resources represents available chroots for builds. API provides only read-only access,
since configuration of the build chroots is done by the service administrator.</p>
<p>Access to the mock chroots is done through <a class="reference internal" href="../general.html#copr.client_v2.client.CoprClient.mock_chroots" title="copr.client_v2.client.CoprClient.mock_chroots"><code class="xref py py-meth docutils literal notranslate"><span class="pre">mock_chroots()</span></code></a>.
property of initialized <a class="reference internal" href="../general.html#copr.client_v2.client.CoprClient" title="copr.client_v2.client.CoprClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">CoprClient</span></code></a>. That property is an instance of
<a class="reference internal" href="../handlers.html#copr.client_v2.handlers.MockChrootHandle" title="copr.client_v2.handlers.MockChrootHandle"><code class="xref py py-class docutils literal notranslate"><span class="pre">MockChrootHandle</span></code></a>. Mock chroots are represented by
<a class="reference internal" href="../resources.html#copr.client_v2.resources.MockChroot" title="copr.client_v2.resources.MockChroot"><code class="xref py py-class docutils literal notranslate"><span class="pre">MockChroot</span></code></a> class.</p>
<div class="section" id="mock-chroot-entity-attributes">
<span id="mock-chroot-attributes"></span><h2>Mock chroot entity attributes<a class="headerlink" href="#mock-chroot-entity-attributes" title="Permalink to this headline">¶</a></h2>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="21%" />
<col width="60%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Field</th>
<th class="head">Type</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>name</td>
<td>str</td>
<td>chroot name</td>
</tr>
<tr class="row-odd"><td>os_release</td>
<td>str</td>
<td>name of distribution system, e.g.: epel, fedora</td>
</tr>
<tr class="row-even"><td>os_version</td>
<td>str</td>
<td>version of distribution system, e.g.: 7, 22</td>
</tr>
<tr class="row-odd"><td>arch</td>
<td>str</td>
<td>architecture of distribution, e.g.: i386, x86_64, ppc64le</td>
</tr>
<tr class="row-even"><td>is_active</td>
<td>bool</td>
<td>defines if this chroot is available for builds</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">all following examples assume that we use <code class="docutils literal notranslate"><span class="pre">cl</span></code>
as an instance of <a class="reference internal" href="../general.html#copr.client_v2.client.CoprClient" title="copr.client_v2.client.CoprClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">client_v2.client.CoprClient</span></code></a></p>
</div>
</div>
<div class="section" id="get-mock-chroot-list">
<h2>Get mock chroot list<a class="headerlink" href="#get-mock-chroot-list" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mlist</span> <span class="o">=</span> <span class="nb">map</span><span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="n">cl</span><span class="o">.</span><span class="n">mock_chroots</span><span class="o">.</span><span class="n">get_list</span><span class="p">(</span><span class="n">active_only</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="n">mlist</span><span class="p">)))</span>
<span class="go">&lt;Mock chroot: epel-6-i386 is active: True&gt;</span>
<span class="go">&lt;Mock chroot: epel-6-x86_64 is active: True&gt;</span>
<span class="go">&lt;Mock chroot: epel-5-i386 is active: True&gt;</span>
<span class="gp">...</span>
</pre></div>
</div>
</div>
<div class="section" id="get-single-mock-chroot">
<h2>Get single mock chroot<a class="headerlink" href="#get-single-mock-chroot" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mc</span> <span class="o">=</span> <span class="n">cl</span><span class="o">.</span><span class="n">mock_chroots</span><span class="o">.</span><span class="n">get_one</span><span class="p">(</span><span class="s2">&quot;fedora-22-i386&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">mc</span><span class="p">)</span>
<span class="go">&lt;Mock chroot: fedora-22-i386 is active: True&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">mc</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>  <span class="n">mc</span><span class="o">.</span><span class="n">os_release</span><span class="p">,</span> <span class="n">mc</span><span class="o">.</span><span class="n">os_version</span><span class="p">,</span> <span class="n">mc</span><span class="o">.</span><span class="n">arch</span><span class="p">)</span>
<span class="go">(u&#39;fedora-22-i386&#39;, u&#39;fedora&#39;, u&#39;22&#39;, u&#39;i386&#39;)</span>
</pre></div>
</div>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../general.html" class="btn btn-neutral float-right" title="General" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="build_task.html" class="btn btn-neutral float-left" title="Build task" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, Red Hat, Inc.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>